Exemplo n.º 1
0
class INamedFileField(interfaces.INamedFileField):

    default = field.NamedFile(
        title=interfaces.INamedFileField['default'].title,
        description=interfaces.INamedFileField['default'].description,
        required=False)

    missing_value = field.NamedFile(
        title=interfaces.INamedFileField['missing_value'].title,
        description=interfaces.INamedFileField['missing_value'].description,
        required=False)
class IRicevutaPagamento(model.Schema):
    """Marker interface for RicevutaPagamento"""

    numero_protocollo = schema.Id(
        title=_("numero_protocollo", default="Numero protocollo"),
        required=True,
    )

    stampa_ricevuta = field.NamedFile(title=_("stampa_ricevuta",
                                              default="Stampa ricevuta"),
                                      required=True)

    data_pagamento = schema.Date(title=_("data_pagamento",
                                         default="Data pagamento"),
                                 required=True)

    importo_pagato = schema.TextLine(title=_("importo_pagato",
                                             default="Importo pagato"),
                                     required=True)

    modalita_pagamento = schema.TextLine(
        title=_("modalita_pagamento", default="Modalità pagamento"),
        required=True,
    )

    # TODO: aggiungere tassonomia e vocabolario rilevante
    servizio_origine = schema.Choice(
        title=_("servizio_origine_ricevuta",
                default="Servizio che origina la pratica"),
        # vocabolario di riferimento sara' il servizio che genera il task e
        # permette di soddisfarlo
        vocabulary="design.plone.contenttypes.Mockup",
        required=False,
    )

    pratica_associata = field.NamedFile(
        title=_("pratica_associata_ricevuta",
                default="Pratica associata al pagamento"),
        required=True,
    )

    # TODO: capire se ci sono altri esiti oltre ai banali "accettato",
    # "rifiutato", "in attesa di conferma",
    # e costruire di conseguenza un vocabolario adeguato
    esito = schema.Choice(
        title=_("esito", default="Esito"),
        vocabulary="design.plone.contenttypes.Mockup",
        required=True,
    )

    allegato = field.NamedFile(title=_("allegato", default="Allegato"),
                               required=False)
Exemplo n.º 3
0
class IImportSurvey(Interface):
    """The fields used for importing a :obj:`euphorie.content.survey`."""

    surveygroup_title = schema.TextLine(
        title=_("label_surveygroup_title",
                default="Title of imported OiRA Tool"),
        description=_(
            "help_upload_surveygroup_title",
            default="If you do not specify a title it will be taken "
            "from the input.",
        ),
        required=False,
    )

    survey_title = schema.TextLine(
        title=_("label_upload_survey_title",
                default="Name for OiRA Tool version"),
        default=_("OiRA Tool import"),
        required=True,
    )

    file = filefield.NamedFile(title=_("label_upload_filename",
                                       default="XML file"),
                               required=True)

    is_etranslate_compatible = schema.Bool(
        title=_(
            "label_is_etranslate_compatible",
            default="Import XML translation from eTranslate",
        ),
        required=False,
        default=False,
    )
Exemplo n.º 4
0
class IImportSector(Interface):
    """ The fields used for importing a :obj:`euphorie.content.sector`.
    """
    sector_title = schema.TextLine(
        title=_("label_sector_title", default=u"Title of sector."),
        description=_(
            "help_sector_title",
            default=u"If you do not specify a title it will be taken "
            u"from the input file."),
        required=False)

    sector_login = LoginField(title=_("label_login_name",
                                      default=u"Login name"),
                              required=True,
                              constraint=validLoginValue)

    surveygroup_title = schema.TextLine(
        title=_("label_surveygroup_title",
                default=u"Title of imported OiRA Tool"),
        description=_(
            "help_upload_surveygroup_title",
            default=u"If you do not specify a title it will be taken "
            u"from the input."),
        required=False)

    survey_title = schema.TextLine(title=_(
        "label_upload_survey_title", default=u"Name for OiRA Tool version"),
                                   default=_(u"Standard"),
                                   required=True)

    file = filefield.NamedFile(title=_("label_upload_filename",
                                       default=u"XML file"),
                               required=True)
class IOIEHealthSafetySecurityDocument(Interface):
    mode(title='hidden')
    title = schema.TextLine(
        title=_(u'Title'),
        required=False,
        default=_(u'will be auto-generated on save'),
    )
    file = field.NamedFile(
        title=_(u'Health, Safety, Security Document'),
        required=True,
    )
Exemplo n.º 6
0
class IReadSample(model.Schema):

    # directives.fieldset(
    #     'metrc',
    #     label=u'METRC',
    #     fields=('rfid','room', 'cannabis'),
    # )

    sample = field.NamedFile(
        title=u'CSV of Samples',
        required=False,
    )
Exemplo n.º 7
0
class IImportSurvey(Interface):
    """ The fields used for importing a :obj:`euphorie.content.survey`.
    """
    surveygroup_title = schema.TextLine(
        title=_("label_surveygroup_title",
                default=u"Title of imported OiRA Tool"),
        description=_(
            "help_upload_surveygroup_title",
            default=u"If you do not specify a title it will be taken "
            u"from the input."),
        required=False)

    survey_title = schema.TextLine(title=_(
        "label_upload_survey_title", default=u"Name for OiRA Tool version"),
                                   default=_(u"OiRA Tool import"),
                                   required=True)

    file = filefield.NamedFile(title=_("label_upload_filename",
                                       default=u"XML file"),
                               required=True)
Exemplo n.º 8
0
class IOIEProgramLeader(Interface):
    """The On-site Program Leader is responsible for providing leadership
    for the group and for overseeing group health and safety.  The On-site
    Program Leader may also teach one or more of the program courses.
    """

    # TODO "There may be only one Program Leader.  Most of the data fields  # noqa
    #   associated with the Program Leader are the same fields used for the
    #   Program Liaison and Program Co-leader/s.  Can the same fields be
    #   used for all three leadership roles?

    # TODO The Program Leader may also be the Program Liaison or one of  # noqa
    #   the Program Co-leaders.

    # TODO Some of these fields also need to be matched to "participant"  # noqa
    #   fields so that we can pull a roster that includes all participants,
    #   leaders and co-leaders. "
    dexteritytextindexer.searchable('title')
    mode(title='hidden')
    title = schema.TextLine(
        title=_(u'Full Name'),
        required=False,
        default=_(u'will be auto-generated on save'),
    )
    dexteritytextindexer.searchable('first_name')
    first_name = schema.TextLine(
        title=_(u'First Name'),
        required=True,
    )
    dexteritytextindexer.searchable('middle_name')
    middle_name = schema.TextLine(
        title=_(u'Middle Name'),
        required=False,
    )
    dexteritytextindexer.searchable('last_name')
    last_name = schema.TextLine(
        title=_(u'Last Name'),
        required=True,
    )
    dexteritytextindexer.searchable('job_title')
    job_title = schema.TextLine(
        title=_(u'Job Title'),
        required=True,
    )
    dexteritytextindexer.searchable('empid')
    empid = schema.TextLine(
        title=_(u'Employee ID'),
        required=True,
    )
    dexteritytextindexer.searchable('office_phone')
    office_phone = schema.TextLine(
        title=_(u'Office Phone'),
        description=_(
            u'Please include country code (if outside US) and area code'
        ),  # noqa
        required=True,
    )
    dexteritytextindexer.searchable('mobile_phone_us')
    mobile_phone_us = schema.TextLine(
        title=_(u'Mobile Phone (US)'),
        description=_(
            u'Please include country code (if outside US) and area code'
        ),  # noqa
        required=True,
    )
    dexteritytextindexer.searchable('mobile_phone_int')
    mobile_phone_int = schema.TextLine(
        title=_(u'Mobile Phone (abroad)'),
        description=_(
            u'Please include country code (if outside US) and area code'
        ),  # noqa
        required=True,
    )
    dexteritytextindexer.searchable('email')
    email = schema.TextLine(
        title=_(u'Email'),
        required=True,
        constraint=validate_email,
    )
    dexteritytextindexer.searchable('other_service')
    other_service = schema.Choice(
        title=_(u'e.g., Line, Skype, Viber, WeChat, WhatsApp'),
        required=False,
        vocabulary=socialmediaservice,
    )
    dexteritytextindexer.searchable('other_username')
    other_username = schema.TextLine(
        title=_(u'username or ID for the above service'),
        required=False,
    )
    dexteritytextindexer.searchable('office_building')
    office_building = schema.Choice(
        title=_(u'Office Building'),
        required=True,
        source=RegistryValueVocabulary('oiestudyabroadstudent.building'),
    )
    dexteritytextindexer.searchable('office_room')
    office_room = schema.TextLine(
        title=_(u'Office Room'),
        required=True,
    )
    dexteritytextindexer.searchable('college_or_unit')
    college_or_unit = schema.Choice(
        title=_(u'College or Unit'),
        description=_(u''),
        required=True,
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.college_or_unit'),  # noqa
    )
    role_and_responsibility = field.NamedFile(
        title=_('Role & Responsibility'),
        description=_(
            u'Upload a signed Program Liaison Role & Responsibilities form'
        ),  # noqa
    )
    dexteritytextindexer.searchable('emergency_contact_name')
    emergency_contact_name = schema.TextLine(
        title=_(u'Emergency Contact Name'),
        required=True,
    )
    dexteritytextindexer.searchable('emergency_contact_relationship')
    emergency_contact_relationship = schema.TextLine(
        title=_(u'Emergency Contact Relationship to You'),
        required=True,
    )
    dexteritytextindexer.searchable('emergency_contact_mobile_phone')
    emergency_contact_mobile_phone = schema.TextLine(
        title=_(u'Emergency Contact Mobile Phone'),
        description=_(
            u'Please include country code (if outside US) and area code'
        ),  # noqa
        required=True,
    )
    dexteritytextindexer.searchable('emergency_contact_other_phone')
    emergency_contact_other_phone = schema.TextLine(
        title=_(u'Emergency Contact Other Phone'),
        description=_(
            u'Please include country code (if outside US) and area code'
        ),  # noqa
        required=True,
    )
    dexteritytextindexer.searchable('emergency_contact_email')
    emergency_contact_email = schema.TextLine(
        title=_(u'Emergency Contact Email'),
        required=True,
        constraint=validate_email,
    )

    #######################################################
    # TODO move JavaScript over for compensation fields  # noqa
    # this appears to be the contents of programedit.js
    # which is currently set to load on the program rather than leader type
    model.fieldset(
        'compensation',
        label=_(u'Compensation'),
        fields=[
            'load_or_overload', 'replacement_costs', 'paid_by',
            'rate_or_lump_sum', 'lump_sum_amount', 'will_base_salary_change',
            'salary_form_type'
        ],
    )
    load_or_overload = schema.Choice(
        title=_(u'Load or Overload'),
        description=_(
            u'Choose whether payment is part of load or is overload'),  # noqa
        required=True,
        vocabulary=load_or_overload,
    )
    replacement_costs = schema.Choice(
        title=_(u'Replacement Costs'),
        description=_(u'Are replacement costs due to the College?'),
        required=False,
        vocabulary=replacement_costs,
    )
    paid_by = schema.Choice(
        title=_(u'Costs are paid by'),
        description=_(u'Choose who pays'),
        required=False,
        vocabulary=paid_by,
    )
    rate_or_lump_sum = schema.Choice(
        title=_(u'Payment Rate or Lump Sum'),
        description=_(u'Choose a payment rate or lump sum'),
        required=False,
        vocabulary=rate_or_lump_sum,
    )
    lump_sum_amount = schema.TextLine(
        title=_(u'Lump sum amount'),
        description=_(u'Enter the lump sum to be paid'),
        required=False,
    )
    will_base_salary_change = schema.Choice(
        title=_(
            u'Will this person'
            's base salary change prior to the date on which this program is scheduled to end?'
        ),  # noqa
        description=_(
            u'If you check '
            'no'
            ' and the base salary changes, any compensation due for this program will be calculated using the current base salary.'
        ),  # noqa
        vocabulary=yes_no_vocabulary,
    )
    salary_form_type = schema.Choice(
        title=_(u'Salary Form Type'),
        vocabulary=salary_form,
        # TODO Applicant should not see this field.  This is for OIE.  It  # noqa
        #   would be better to put this on the "Program Finances" tab, but this
        #   field is specific to each Program Leader rather than to the
        #   program.
    )
    #######################################################
    model.fieldset(
        'Marketing Material',
        label=_(u'Marketing Material'),
        fields=[
            'number_study_abroad_away_fair_flyers',
            'number_study_abroad_away_fair_posters',
            'number_study_abroad_away_fair_brochures'
        ],
    )
    number_study_abroad_away_fair_flyers = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Flyers'),
        description=
        _(u'Indicate the number (max: 999) of flyers, posters and brochures to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=999,
        default=0,
    )
    number_study_abroad_away_fair_posters = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Posters'),
        description=
        _(u'Indicate the number (max: 99) of posters, posters and brochures to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=99,
        default=0,
    )
    number_study_abroad_away_fair_brochures = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Brochures'),
        description=
        _(u'Indicate the number (max: 999) of brochures, posters and brochures to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=999,
        default=0,
    )
    #######################################################
    # TODO Either "passport" or "driver's license" should appear in place  # noqa
    #   of "See Comment" depending on the list of "countries" associated
    #   with the applicant's program.  (If the document name can't be
    #   generated based on other data in the system, add this text below
    #   "Travel Document": Complete the following using information from
    #   your unexpired passport (required for international travel) or with
    #   your unexpired driver's license (for domestic travel only). Can we
    #   use the same data fields as are used for the Participants in the
    #   "applicant" portal?
    model.fieldset(
        'Travel Document',
        label=_(u'Travel Document'),
        fields=[
            'travel_document_last_name', 'travel_document_first_name',
            'travel_document_middle_name', 'date_of_birth', 'gender',
            'document_number', 'document_expiry_date'
        ],
    )
    travel_document_first_name = schema.TextLine(
        title=_(u'Travel Document: First Name'),
        description=
        _(u'If you are flying to your destination, the name on your airline ticket must match the name on your ID exactly.  Type your first name exactly as it Appears on the ID.  IF MULTIPLE FIRST NAMES APPEAR ON THE ID, type all first names that appear on the ID in this field.  If typed incorrectly, you will be responsible for any name change fee charged by the airline or by the travel agency.'
          ),  # noqa
        required=True,
    )
    travel_document_middle_name = schema.TextLine(
        title=_(u'Travel Document: Middle Name'),
        description=
        _(u'If you are flying to your destination, the name on your airline ticket must match the name on your ID exactly.  IF YOUR MIDDLE NAME APPEARS ON YOUR ID, you must type your middle name in this field exactly as it appears on the ID.  IF YOUR MIDDLE INITIAL APPEARS ON YOUR ID, you must type only your middle initial in this field.  IF MULTIPLE MIDDLE NAMES APPEAR ON YOUR ID, you must type all middle names that appear on your ID in this field.  IF YOUR MIDDLE NAME DOES NOT APPEAR ON YOUR ID, do not include your middle name in this field.  If typed incorrectly, you will be responsible for any name change fee charged by the airline or by the travel agency.'
          ),  # noqa
        required=False,
    )
    travel_document_last_name = schema.TextLine(
        title=_(u'Travel Document: Last Name'),
        description=
        _(u'If you are flying to your destination, the name on your airline ticket must match the name on your ID exactly.  Type your last name exactly as it Appears on the ID.  IF MULTIPLE LAST NAMES APPEAR ON THE ID, type all last names that appear on the ID in this field.  If typed incorrectly, you will be responsible for any name change fee charged by the airline or by the travel agency.  '
          ),  # noqa
        required=True,
    )
    date_of_birth = schema.Date(
        title=_(u'Travel Document: Date of Birth'),
        required=True,
    )
    gender = schema.Choice(
        title=_(u'Travel Document: Gender (Sex)'),
        description=_(
            u'Select the sex that is listed on your travel document.'),  # noqa
        source=RegistryValueVocabulary('oiestudyabroadstudent.genders'),
        required=True,
    )
    document_number = schema.TextLine(
        title=_(u'Travel Document: Document Number'),
        description=_(u''),
        required=True,
    )
    document_expiry_date = schema.Date(
        title=_(u'Travel Document: Expiry Date'),
        description=
        _(u'You may not enter details for a document that is expired or for a document that will expire prior to the final travel return date for your program.'
          ),  # noqa
        required=True,
    )
    #######################################################
    # TODO this fieldset should be hidden from the person adding their Leader profile.  Who is allowed to see it?  # noqa
    model.fieldset(
        'Office Use Only',
        label=_(u'Office Use Only'),
        fields=[
            'orientation_completed_date', 'cash_advance_request',
            'cash_advance_distribution', 'hr_review_ok',
            'administrative_services_review_ok', 'equal_opportunity_review_ok'
        ],
    )
    orientation_completed_date = schema.Date(
        title=_(u'Program Leader Orientation Completed'),
        description=_(u'Confirm attendance at orientation'),
        required=False,
    )
    cash_advance_request = field.NamedFile(
        title=_(u'Cash Advance Request'),
        description=_(u'Upload the signed Cash Advance Form'),
        required=False,
    )
    cash_advance_distribution = schema.Date(
        title=_(u'Cash Advance Distribution'),
        description=
        _(u'Enter the date on which the cash advance was distributed to the Program Leader/Program Co-leader'
          ),  # noqa
        required=False,
    )
    hr_review_ok = schema.Choice(
        title=_(u'HR Review'),
        description=_(
            u'There are no actions pending that may affect the Provost'
            's decision to approve this applicant as a Leader or Co-leader for a study abroad/away program'
        ),  # noqa
        vocabulary=yes_no_vocabulary,
        required=False,
        # TODO Or, is this its own workflow?  # noqa
    )
    administrative_services_review_ok = schema.Choice(
        title=_(u'Administrative Services Review'),
        description=_(
            u'This applicant does not have any past due travel or cash advances'
        ),  # noqa
        vocabulary=yes_no_vocabulary,
        required=False,
        # TODO Or, is this its own workflow?  # noqa
    )
    equal_opportunity_review_ok = schema.Choice(
        title=_(u'Office of Equal Opportunity & Access Review'),
        description=_(
            u'There are no actions pending that may affect the Provost'
            's decision to approve this applicant as a Leader or Co-leader for a study abroad/away program.'
        ),  # noqa
        vocabulary=yes_no_vocabulary,
        required=False,
        # TODO Or, is this its own workflow?  # noqa
    )
Exemplo n.º 9
0
class IDXTestDocumentSchema(model.Schema):

    # zope.schema fields
    test_ascii_field = schema.ASCII(required=False)
    test_asciiline_field = schema.ASCIILine(required=False)
    test_bool_field = schema.Bool(required=False)
    test_bytes_field = schema.Bytes(required=False)
    test_bytesline_field = schema.BytesLine(required=False)
    test_choice_field = schema.Choice(values=[u"foo", u"bar"], required=False)
    test_choice_field_with_vocabulary = schema.Choice(
        vocabulary=SimpleVocabulary([
            SimpleTerm(u"value1", "token1", u"title1"),
            SimpleTerm(u"value2", "token2", u"title2"),
        ]),
        required=False,
    )
    test_date_field = schema.Date(required=False)
    test_datetime_field = schema.Datetime(required=False)
    test_datetime_tz_field = schema.Datetime(
        required=False,
        defaultFactory=lambda: timezone("Europe/Zurich").localize(
            datetime(2017, 10, 31, 10, 0)),
    )
    test_decimal_field = schema.Decimal(required=False)
    test_dict_field = schema.Dict(required=False)
    test_float_field = schema.Float(required=False)
    test_frozenset_field = schema.FrozenSet(required=False)
    test_int_field = schema.Int(required=False)
    test_list_field = schema.List(required=False)
    test_list_field_with_choice_with_vocabulary = schema.List(
        value_type=schema.Choice(vocabulary=SimpleVocabulary([
            SimpleTerm(u"value1", "token1", u"title1"),
            SimpleTerm(u"value2", "token2", u"title2"),
            SimpleTerm(u"value3", "token3", u"title3"),
        ])),
        required=False,
    )
    test_set_field = schema.Set(required=False)
    test_text_field = schema.Text(required=False)
    test_textline_field = schema.TextLine(required=False)
    test_time_field = schema.Time(required=False)
    test_timedelta_field = schema.Timedelta(required=False)
    test_tuple_field = schema.Tuple(required=False)
    test_nested_list_field = schema.List(required=False,
                                         value_type=schema.Tuple())
    test_nested_dict_field = schema.Dict(required=False,
                                         key_type=schema.ASCIILine(),
                                         value_type=schema.Tuple())
    test_list_choice_with_context_vocabulary_field = schema.List(
        title=u"Field",
        value_type=schema.Choice(
            vocabulary="plone.restapi.testing.context_vocabulary"),
        required=False,
    )

    # plone.app.textfield
    test_richtext_field = RichText(
        required=False, allowed_mime_types=["text/html", "text/plain"])

    # plone.namedfile fields
    test_namedfile_field = namedfile.NamedFile(required=False)
    test_namedimage_field = namedfile.NamedImage(required=False)
    test_namedblobfile_field = namedfile.NamedBlobFile(required=False)
    test_namedblobimage_field = namedfile.NamedBlobImage(required=False)

    # z3c.relationfield
    test_relationchoice_field = RelationChoice(
        required=False, source=CatalogSource(id=["doc1", "doc2"]))
    test_relationlist_field = RelationList(
        required=False,
        value_type=RelationChoice(vocabulary="plone.app.vocabularies.Catalog"),
    )

    # Test fields for validation
    test_required_field = schema.TextLine(required=True)
    test_readonly_field = schema.TextLine(required=False, readonly=True)
    test_maxlength_field = schema.TextLine(required=False, max_length=10)
    test_constraint_field = schema.TextLine(required=False,
                                            constraint=lambda x: u"00" in x)
    test_datetime_min_field = schema.Datetime(required=False,
                                              min=datetime(2000, 1, 1))
    test_time_min_field = schema.Time(required=False, min=time(1))
    test_timedelta_min_field = schema.Timedelta(required=False,
                                                min=timedelta(100))
    test_list_value_type_field = schema.List(required=False,
                                             value_type=schema.Int())
    test_dict_key_type_field = schema.Dict(required=False,
                                           key_type=schema.Int())

    read_permission(test_read_permission_field="cmf.ManagePortal")
    test_read_permission_field = schema.TextLine(required=False)
    write_permission(test_write_permission_field="cmf.ManagePortal")
    test_write_permission_field = schema.TextLine(required=False)

    read_permission(test_read_permission_field="cmf.ManagePortal")
    test_read_permission_field = schema.TextLine(required=False)

    test_invariant_field1 = schema.TextLine(required=False)
    test_invariant_field2 = schema.TextLine(required=False)

    test_missing_value_field = schema.TextLine(required=False,
                                               missing_value=u"missing",
                                               default=u"default")

    test_missing_value_required_field = schema.TextLine(
        required=True, missing_value=u"missing", default=u"some value")

    @invariant
    def validate_same_value(data):
        if data.test_invariant_field1 != data.test_invariant_field2:
            raise Invalid(u"Must have same values")

    # Test fields with default values
    test_default_value_field = schema.TextLine(required=True,
                                               default=u"Default")

    @provider(IContextAwareDefaultFactory)
    def default_factory(context):
        return u"DefaultFactory"

    test_default_factory_field = schema.TextLine(
        required=True, defaultFactory=default_factory)
Exemplo n.º 10
0
class IDXTestDocumentSchema(model.Schema):

    # zope.schema fields
    test_ascii_field = schema.ASCII(required=False)
    test_asciiline_field = schema.ASCIILine(required=False)
    test_bool_field = schema.Bool(required=False)
    test_bytes_field = schema.Bytes(required=False)
    test_bytesline_field = schema.BytesLine(required=False)
    test_choice_field = schema.Choice(values=[u'foo', u'bar'], required=False)
    test_date_field = schema.Date(required=False)
    test_datetime_field = schema.Datetime(required=False)
    test_datetime_tz_field = schema.Datetime(
        required=False,
        defaultFactory=lambda: timezone("Europe/Zurich").localize(
            datetime(2017, 10, 31, 10, 0)))
    test_decimal_field = schema.Decimal(required=False)
    test_dict_field = schema.Dict(required=False)
    test_float_field = schema.Float(required=False)
    test_frozenset_field = schema.FrozenSet(required=False)
    test_int_field = schema.Int(required=False)
    test_list_field = schema.List(required=False)
    test_set_field = schema.Set(required=False)
    test_text_field = schema.Text(required=False)
    test_textline_field = schema.TextLine(required=False)
    test_time_field = schema.Time(required=False)
    test_timedelta_field = schema.Timedelta(required=False)
    test_tuple_field = schema.Tuple(required=False)
    test_nested_list_field = schema.List(
        required=False, value_type=schema.Tuple())
    test_nested_dict_field = schema.Dict(
        required=False, key_type=schema.ASCIILine(), value_type=schema.Tuple())
    test_list_choice_with_context_vocabulary_field = schema.List(
        title=u'Field',
        value_type=schema.Choice(
            vocabulary='plone.restapi.testing.context_vocabulary'),
        required=False)

    # plone.app.textfield
    test_richtext_field = RichText(
        required=False, allowed_mime_types=['text/html', 'text/plain'])

    # plone.namedfile fields
    test_namedfile_field = namedfile.NamedFile(required=False)
    test_namedimage_field = namedfile.NamedImage(required=False)
    test_namedblobfile_field = namedfile.NamedBlobFile(required=False)
    test_namedblobimage_field = namedfile.NamedBlobImage(required=False)

    # z3c.relationfield
    test_relationchoice_field = RelationChoice(
        required=False, source=CatalogSource(id=['doc1', 'doc2']))
    test_relationlist_field = RelationList(
        required=False, value_type=RelationChoice(
            vocabulary="plone.app.vocabularies.Catalog"))

    # Test fields for validation
    test_required_field = schema.TextLine(required=True)
    test_readonly_field = schema.TextLine(required=False, readonly=True)
    test_maxlength_field = schema.TextLine(required=False, max_length=10)
    test_constraint_field = schema.TextLine(required=False,
                                            constraint=lambda x: u'00' in x)
    test_datetime_min_field = schema.Datetime(required=False,
                                              min=datetime(2000, 1, 1))
    test_time_min_field = schema.Time(required=False, min=time(1))
    test_timedelta_min_field = schema.Timedelta(required=False,
                                                min=timedelta(100))
    test_list_value_type_field = schema.List(required=False,
                                             value_type=schema.Int())
    test_dict_key_type_field = schema.Dict(required=False,
                                           key_type=schema.Int())

    read_permission(test_read_permission_field='cmf.ManagePortal')
    test_read_permission_field = schema.TextLine(required=False)
    write_permission(test_write_permission_field='cmf.ManagePortal')
    test_write_permission_field = schema.TextLine(required=False)

    read_permission(test_read_permission_field='cmf.ManagePortal')
    test_read_permission_field = schema.TextLine(required=False)

    test_invariant_field1 = schema.TextLine(required=False)
    test_invariant_field2 = schema.TextLine(required=False)

    @invariant
    def validate_same_value(data):
        if data.test_invariant_field1 != data.test_invariant_field2:
            raise Invalid(u'Must have same values')

    # Test fields with default values
    test_default_value_field = schema.TextLine(
        required=True, default=u'Default')

    @provider(IContextAwareDefaultFactory)
    def default_factory(context):
        return u'DefaultFactory'

    test_default_factory_field = schema.TextLine(
        required=True, defaultFactory=default_factory)
Exemplo n.º 11
0
class IOIECourse(Interface):
    mode(title='hidden')
    title = schema.TextLine(
        title=_(u'Course Title'),
        required=False,
        default=_(u'will be auto-generated on save'),
    )
    course = schema.Choice(
        title=_(u'UW Oshkosh Course Subject & Number'),
        description=_(
            u'Add all courses associated with your program, including courses '
            u'that will be taught partially at UW Oshkosh and partially while '
            u'away on the program.  Do not include courses that will be '
            u'taught entirely at UWO, even when these courses are offered '
            u'in preparation for the program away.  Contact the OIE to add '
            u'a course ([email protected]).'),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.course_subject_and_number'),  # noqa
    )
    credits_earned = schema.Int(
        title=_(u'UW Oshkosh Credits Earned'),
        description=_(
            u'Enter the number of credits that participants will earn for '
            u'each individual course.  If you are offering a course that can '
            u'be taught for a range of credits on your program (e.g. 3-5 '
            u'credits), you must enter the course into this system multiple '
            u'times, giving the course a different credit value each time '
            u'that you enter it.'),
    )
    class_start_date = schema.Date(
        title=_(u'Class Start Date'),
        # TODO Auto-generate the first day of the term in which this program  # noqa
        #  runs from the calendar?????  Maybe this isn't possible.
    )
    class_end_date = schema.Date(
        title=_(u'Class End Date'),
        # TODO If the "PeopleSoft Class End Date" is AFTER the Official  # noqa
        #  Graduation Date, prompt the coursebuilder to complete the
        #  "Course End Date Extension Form".
    )
    min_credits = schema.Int(
        title=_(u'Course Prerequisites: minimum number of credits'),
        description=_(
            u'If this course requires a minimum number of completed credits '
            u'prior to the course start date, indicate this here'),
        min=0,
        max=999,
    )
    gpa = schema.Int(
        title=_(u'Course Prerequisites: GPA'),
        description=_(u'If this course requires a minimum GPA prior to the '
                      u'course start date, indicate this here.'),
        min=0,
        max=999,
    )
    completed_courses = schema.Text(
        title=_(u'Course Prerequisites: completed courses'),
        description=_(
            u'If this course requires that other courses be completed, or '
            u'that a particular grade be earned in an earlier course, prior '
            u'to the course start date, indicate this here.'),
    )
    program_of_study = schema.Choice(
        title=_(u'Course Prerequisites: program of study'),
        description=_(
            u'If this course requires admission to a particular program of '
            u'study prior to the course start date, indicate this here.'),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.program_of_study', ),
    )
    instruction_provided_by_host = schema.Choice(
        title=_(u'Instruction Provided by Host?'),
        description=_(
            u'Select the name of the person who will teach the course, if the '
            u'course is to be taught by a UW Oshkosh professor.  Select '
            u'"host" when instruction is provided by a partner.  Do not '
            u'select the name of the "instructor-of-record" at UW Oshkosh '
            u'when instruction is provided by a partner.'),
        vocabulary=yes_no_vocabulary,
    )
    instruction_provided_by = schema.Choice(
        title=_(u'Instruction Provided by (if not host)'),
        description=_(
            u'Select the name of the person who will teach the course, if the '
            u'course is to be taught by a UW Oshkosh professor.  Select '
            u'"host" when instruction is provided by a partner.  Do not '
            u'select the name of the "instructor-of-record" at UW Oshkosh '
            u'when instruction is provided by a partner.'),
        vocabulary='uwosh.oie.studyabroadstudent.vocabularies.program_leader',
        required=False,
    )
    course_enrollment_at = schema.Choice(
        title=_(u'Course Enrollment at'),
        description=_(
            u'Indicate the institution at which program participants will be '
            u'enrolled for each individual course.'),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.enrollment_institution', ),
        required=True,
    )
    foreign_institution = schema.Choice(
        title=_(u'Foreign Institution Name'),
        description=_(u''),
        vocabulary=
        'uwosh.oie.studyabroadstudent.vocabularies.cooperatingpartner',  # noqa
        required=True,
        # TODO Oshkosh must be the first option on this dropdown list  # noqa
    )
    foreign_course_number = schema.Text(
        title=_(u'Foreign Course Number'),
        description=_(u''),
    )
    foreign_course_credits = schema.Int(
        title=_(u'Foreign Course Number of Credits'),
        description=_(u'max: 2 digits'),
        min=0,
        max=99,
    )
    foreign_course_review_date = schema.Date(
        title=_(u'Foreign Course Date of Most Recent Review'),
        description=_(u''),
    )
    foreign_course_reviewer_info = schema.TextLine(
        title=_(u'Foreign Course Reviewer Name, Title & College'),
        description=_(u''),
    )
    foreign_course_syllabus = field.NamedFile(
        title=_(u'Foreign Course Syllabus'),
        description=_(u'Upload the syllabus that corresponds to the most '
                      u'recent date of review'),
    )
    foreign_course_builder_email = schema.TextLine(
        title=_(u'PeopleSoft Course Builder'),
        description=_(
            u'Enter the email address of the person in your department who '
            u'will build your course/s in PeopleSoft.  If instruction is '
            u'provided by the host institution, with no concurrent '
            u'enrollment at UWO, enter [email protected] into the email address '
            u'field.'),
        constraint=validate_email,
        # TODO "A message should be generated to the course builder email  # noqa
        #  addresses associated with each course.  Course builders should have
        #  access to all ""Course Subject & Number"" related fields and must
        #  have permission to edit greyed out fields in this section only.
        # TODO Course builders may request instructions on how to build study  # noqa
        #  abroad/away sections in PeopleSoft by emailing [email protected].
        #  Course builders enter the data requested below; Financial Services
        #  uses this data to properly set tuition & fees for each course."
    )
    ps_course_id = schema.Int(
        title=_(u'PeopleSoft Course ID'),
        min=0,
    )
    ps_class_id = schema.Int(
        title=_(u'PeopleSoft Class Number'),
        min=0,
    )
    ps_section_id = schema.Int(
        title=_(u'PeopleSoft Course Section Number'),
        min=0,
    )
    ps_section_letter = schema.TextLine(
        title=_(u'PeopleSoft Course Section Letter'),
        # TODO dropdown?  # noqa
    )
    ps_grade_by_date = schema.Date(
        title=_(u'PeopleSoft "grade by" date'),
        # TODO Autogenerate the "PeopleSoft 'grade by' date" by adding 5  # noqa
        #  calendar days to the "PeopleSoft Class End Date".
    )
    tuition_and_fees = schema.Choice(
        title=_(u'Tuition & Fees'),
        vocabulary='oiestudyabroadstudent.tuition_and_fees',
    )
    ext_studies_graded = schema.Choice(
        title=_(u'External Studies Courses'),
        description=_(
            u'Confirm that any External Studies Courses have been graded.'
        ),  # noqa
        vocabulary=yes_no_vocabulary,
        # TODO This field must be associated with each Ext Studies Course  # noqa
        #  listed in "Course Subject & Number".
    )
Exemplo n.º 12
0
class INamedFileSchema(form.Schema):
    form.primary('named_file')
    named_file = field.NamedFile(
        title=u'namedfile',
        required=False,
        )
Exemplo n.º 13
0
class IActorBehavior(model.Schema):
    """ Add actor behavior"""

    first_name = schema.TextLine(title=_("Fornavn", default=u"Fornavn"), )

    last_name = schema.TextLine(
        title=_("Etternavn", default=u"Etternavn"),
        required=True,
    )

    image = namedfile.NamedBlobImage(
        title=_("profile_image", default=u"Profil image"),
        required=True,
    )

    sex = schema.List(title=_("sex", default=u"Kjønne etc."),
                      value_type=schema.Choice(title=_("sex etc",
                                                       default=u"Kjønn etc"),
                                               vocabulary=SexVocabulary))

    phone = schema.TextLine(
        title=_("phone", default=u"Telefon"),
        required=False,
    )

    email = Email(
        title=_("email", default=u"E-post"),
        required=False,
    )

    born = schema.Date(title=_("born", default=u"Fødselsdato"), )

    adresse = schema.Text(
        title=_("Adresse", default=u"Adresse"),
        required=False,
    )

    eye_color = schema.Choice(title=_("eye_color", default=u"Øyefarge"),
                              required=True,
                              vocabulary='medialog.casting.EyeColorVocabulary')

    hair_color = schema.Choice(
        title=_("hair_color", default=u"Hår farge"),
        required=True,
        vocabulary='medialog.casting.HairColorVocabulary')

    etnisitet = schema.List(
        title=_("Etnisitet", default=u"Etnisitet"),
        value_type=schema.Choice(
            title=_("Etnisitet", default=u"Etnisitet"),
            required=False,
            vocabulary='medialog.casting.EtnisitetVocabulary'))

    languages = schema.List(
        title=_("Languages", default=u"Languages"),
        value_type=schema.Choice(
            title=_("Language", default=u"Language"),
            required=False,
            vocabulary='medialog.casting.LanguageVocabulary'))

    dialekt = schema.TextLine(
        title=_("Dialekt", default=u"Dialekt"),
        required=False,
    )

    height = schema.Int(title=_("height", default=u"Høyde i cm"),
                        min=40,
                        max=240)

    weight = schema.Int(title=_("Vekt", default=u"Vekt i kilo"),
                        min=25,
                        max=180)

    driving_licence = schema.List(
        title=_("driver_lincence", default=u"Førerkort"),
        value_type=schema.Choice(
            title=u'Lisenstype',
            vocabulary='medialog.casting.DriverLicenceVocabulary'),
        required=False,
    )

    erfaring = schema.List(
        title=_("Erfaring", default=u"Erfaring"),
        description=_("En pr linje", default=u"En erfaring pr linje"),
        value_type=schema.TextLine(
            title=u'Erfaring',
            required=False,
        ),
        required=False,
    )

    shoe_size = schema.TextLine(
        title=_("shoe_size", default=u"Skostørrelse"),
        required=False,
    )

    jacket_size = schema.TextLine(
        title=_("jacket_size", default=u"Jakkestørrelse"),
        required=False,
    )

    trousers_size = schema.TextLine(
        title=_("trousers_size", default=u"Buksestørrelse"),
        required=False,
    )

    cv = namedfile.NamedFile(
        title=_("cv", default=u"CV (fil)"),
        required=False,
    )

    video = schema.URI(
        title=_("video", default=u"Video link"),
        required=False,
    )

    relatedItems = RelationList(
        title=_(u'label_related_items', default=u'Prosjekter'),
        default=[],
        value_type=RelationChoice(
            title=u'Prosjekter',
            source=CatalogSource(portal_type=['prosjekt', 'Prosjekt']),
        ),
        required=False,
    )

    directives.widget('relatedItems',
                      RelatedItemsFieldWidget,
                      pattern_options={
                          'basePath': '/',
                          "mode": "auto",
                          "favorites": []
                      })
Exemplo n.º 14
0
class IOIELiaison(Interface):
    """The Liaison to the OIE communicates decisions related to program
development and delivery to the Program Manager in the OIE and
communicates program changes and updates to his/her unit administration.
There is only one Liaison per program;  all decision-making at the
unit level must be communicated to the OIE through the designated
liaison. The Liaison may also include the OIE Program Manager and/or
other OIE staff in conversations or seek input when appropriate.
The Liaison may also serve as the On-site Program Leader and may
also teach one or more of the program courses.
"""
    dexteritytextindexer.searchable('title')

    mode(title='hidden')
    title = schema.TextLine(
        title=_(u'Full Name'),
        required=False,
        default=_(u'will be auto-generated on save'),
    )
    dexteritytextindexer.searchable('first_name')
    first_name = schema.TextLine(
        title=_(u'First Name'),
        required=True,
    )
    dexteritytextindexer.searchable('middle_name')
    middle_name = schema.TextLine(
        title=_(u'Middle Name'),
        required=False,
    )
    dexteritytextindexer.searchable('last_name')
    last_name = schema.TextLine(
        title=_(u'Last Name'),
        required=True,
    )
    dexteritytextindexer.searchable('job_title')
    job_title = schema.TextLine(
        title=_(u'Job Title'),
        required=True,
    )
    dexteritytextindexer.searchable('office_phone')
    office_phone = schema.TextLine(
        title=_(u'Office Phone'),
        description=_(
            u'Please include country code (if outside US) and area code', ),
        required=True,
    )
    dexteritytextindexer.searchable('mobile_phone_us')
    mobile_phone_us = schema.TextLine(
        title=_(u'Mobile Phone (US)'),
        description=_(
            u'Please include country code (if outside US) and area code', ),
        required=True,
    )
    dexteritytextindexer.searchable('email')
    email = schema.TextLine(
        title=_(u'Email'),
        required=True,
        constraint=validate_email,
    )
    dexteritytextindexer.searchable('other_service')
    other_service = schema.Choice(
        title=_(u'e.g., Line, Skype, Viber, WeChat, WhatsApp'),
        required=False,
        vocabulary=socialmediaservice,
    )
    dexteritytextindexer.searchable('other_username')
    other_username = schema.TextLine(
        title=_(u'username or ID for the above service'),
        required=False,
    )
    dexteritytextindexer.searchable('office_building')
    office_building = schema.Choice(
        title=_(u'Office Building'),
        required=True,
        source=RegistryValueVocabulary('oiestudyabroadstudent.building'),
    )
    dexteritytextindexer.searchable('office_room')
    office_room = schema.TextLine(
        title=_(u'Office Room'),
        required=True,
    )
    dexteritytextindexer.searchable('college_or_unit')
    college_or_unit = schema.Choice(
        title=_(u'College or Unit'),
        description=_(u''),
        required=True,
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.college_or_unit', ),
    )
    role_and_responsibility = field.NamedFile(
        title=_('Role & Responsibility'),
        description=_(
            u'Upload a signed Program Liaison Role & Responsibilities form', ),
    )
    #######################################################
    model.fieldset(
        'Marketing Material',
        label=_(u'Marketing Material'),
        fields=[
            'number_study_abroad_away_fair_flyers',
            'number_study_abroad_away_fair_posters',
            'number_study_abroad_away_fair_brochures'
        ],
    )
    number_study_abroad_away_fair_flyers = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Flyers'),
        description=
        _(u'Indicate the number (max: 999) of flyers to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=999,
    )
    number_study_abroad_away_fair_posters = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Posters'),
        description=
        _(u'Indicate the number (max: 99) of posters to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=99,
    )
    number_study_abroad_away_fair_brochures = schema.Int(
        title=_(u'Number of Study Abroad/Away Fair Brochures'),
        description=
        _(u'Indicate the number (max: 999) of brochures to be sent to you at the beginning of each semester. OIE can respond to additional requests for materials at any time'
          ),  # noqa
        min=0,
        max=999,
    )
class ISchemaWithNamedFile(Interface):
    field = field.NamedFile()
Exemplo n.º 16
0
class IDocumentoPersonale(model.Schema):
    """Marker interface for DocumentoPersonale"""

    protocollo = schema.TextLine(title=_("protocollo", default="Protocollo"),
                                 required=True)

    data_protocollo = schema.Date(
        title=_("data_protocollo", default="Data del protocollo"),
        required=True,
    )

    immagine = field.NamedImage(title=_("immagine", default="Immagine"),
                                required=False)

    pratica_associata = field.NamedFile(
        title=_("pratica_associata", default="Pratica associata"),
        required=True,
    )

    servizio_origine = schema.Choice(
        title=_("servizio_origine",
                default="Servizio che genera il documento"),
        vocabulary="design.plone.contenttypes.Mockup",
        required=True,
    )

    # TODO: come gestiamo i campi "Tipologia del documento", "sottotipologia
    # del documento" e "lingua del documento"?

    # TODO: il vocabolario controllato da usare sara' "Argomenti di interesse
    #  pere gli utenti di un comune"
    argomenti_utenti = schema.Choice(
        title=_("argomenti_utenti", default="Argomenti utenti"),
        vocabulary="design.plone.contenttypes.Mockup",
        required=True,
    )

    oggetto = BlocksField(
        title=_("oggetto", default="Oggetto"),
        # non viene specificato se il campo e' obbligatorio o meno
        required=False,
    )

    # TODO: decidere se "link al documento" sara' un folder o un file. Se e'
    # un folder "formati disponibili" diventa un campo
    # generato facendo una query dei file presenti all'interno di "link al
    #  documento"?
    # Inserito come folder "Allegati" per il momento, magari si chiede

    # TODO: usare vocabolario dinamico per le tipologie di uffici (dovrebbe
    # rientrare nel content type "Unita' organizzativa")
    ufficio_responsabile = schema.Choice(
        title=_(
            "ufficio_responsabile_documento_personale",
            default="Ufficio responsabile",
        ),
        required=True,
        vocabulary="design.plone.contenttypes.Mockup",
    )

    # TODO: usare vocabolario dinamico per le tipologie di aree amministrative
    # (dovrebbe rientrare nel content type "Unita' organizzativa")
    area_responsabile = schema.Choice(
        title=_(
            "area_responsabile_documento_personale",
            default="Area responsabile",
        ),
        required=True,
        vocabulary="design.plone.contenttypes.Mockup",
    )

    # TODO: usare vocabolario dinamico per le gli autori?
    autori = RelationList(
        title="Autore/i",
        default=[],
        value_type=RelationChoice(title=_("Autore"),
                                  vocabulary="plone.app.vocabularies.Catalog"),
        required=False,
    )

    licenza_distribuzione = schema.TextLine(
        title=_("licenza_distribuzione", default="Licenza di distribuzione"),
        required=False,
    )

    # TODO: usare vocabolario dinamico per i servizi collegati?
    servizi_collegati = RelationList(
        title="Servizi collegati",
        default=[],
        value_type=RelationChoice(
            title=_("Servizio collegato"),
            vocabulary="plone.app.vocabularies.Catalog",
        ),
        required=False,
    )

    canale_digitale_servizio = schema.TextLine(
        title=_(
            "canale_digitale_servizio",
            default="Canale digitale servizio collegato",
        ),
        required=False,
    )

    data_inizio = schema.Date(title=_("data_inizio", default="Data di inizio"),
                              required=False)

    data_e_fasi_intermedie = BlocksField(
        title=_("data_e_fasi_intermedie", default="Data e fasi intermedie"),
        required=False,
    )

    data_inizio = schema.Date(title=_("data_inizio", default="Data di inizio"),
                              required=False)

    # TODO: vocabolario per i dataset collegati ad un documento
    dataset = RelationList(
        title=_("Dataset"),
        required=False,
        default=[],
        value_type=RelationChoice(
            title=_("Dataset collegato"),
            vocabulary="plone.app.vocabularies.Catalog",
        ),
    )

    informazioni = BlocksField(
        title=_("informazioni", default="Ulteriori informazioni"),
        required=False,
    )

    riferimenti_normativi = BlocksField(
        title=_("riferimenti_normativi", default="Riferimenti normativi"),
        required=False,
    )
class IOIEStudyAbroadParticipant(Interface):
    dexteritytextindexer.searchable('title')
    omitted('title')
    title = schema.TextLine(
        title=_(u'Title'),
        required=False,
        readonly=True,
        default=_(u'will be auto-generated'),
    )

    #######################################################
    model.fieldset(
        'participant_name',
        label=_(u'Name'),
        fields=[
            'firstName',
            'middleName',
            'lastName',
        ],
    )

    dexteritytextindexer.searchable('firstName')
    firstName = schema.TextLine(
        title=_(u'First Name'),
        required=True,
    )

    dexteritytextindexer.searchable('middleName')
    middleName = schema.TextLine(
        title=_(u'Middle Name'),
        required=False,
    )

    dexteritytextindexer.searchable('lastName')
    lastName = schema.TextLine(
        title=_(u'Last Name'),
        required=True,
    )

    #######################################################
    model.fieldset(
        'progress',
        label=_(u'Progress'),
        fields=[
            'seatNumber',
            'waitlistNumber',
        ],
    )

    seatNumber = schema.TextLine(
        title=_(u'Seat Number'),
        description=_(u'auto generate using STEP II date/time stamp and min/max participant fields from "program development" workflow'), # noqa : E501
        #  TODO (BD) - verify this functionality  # noqa : T000
        # required=False,
    )

    waitlistNumber = schema.TextLine(
        title=_(u'Waitlist Number'),
        description=_(u'auto generate using STEP II date/time stamp and min/max participant fields from "program development" workflow'), # noqa : E501
        #  TODO (BD) - verify this functionality  # noqa : T000
        # required=False,
    )

    #######################################################
    model.fieldset(
        'interest',
        label=_(u'Express Interest'),
        fields=[
            'email',
            'programName',
            'programName2',
            'programName3',
        ],
    )

    dexteritytextindexer.searchable('email')
    email = schema.TextLine(
        title=_(u'Email Address'),
        description=_(
            u'UW Oshkosh students must use a @uwosh.edu email address.  Acceptable email addresses for other applicants include school and company addresses.'),  # noqa : E501
        constraint=validate_email,
        # TODO - write test_validate_email  # noqa : T000
        required=True,
    )

    dexteritytextindexer.searchable('programName')
    programName = schema.Choice(
        title=_(u'Program Name (first choice)'),
        description=_(u'The courses listed for this program choice will appear in your Courses tab; you must indicate there which courses you wish to enroll in.'),  # noqa : E501
        vocabulary='uwosh.oie.studyabroadstudent.vocabularies.newprograms',
        required=True,
    )

    dexteritytextindexer.searchable('programName2')
    programName2 = schema.Choice(
        title=_(u'Program Name (second choice)'),
        vocabulary='uwosh.oie.studyabroadstudent.vocabularies.newprograms',
        required=False,
    )

    dexteritytextindexer.searchable('programName3')
    programName3 = schema.Choice(
        title=_(u'Program Name (third choice)'),
        vocabulary='uwosh.oie.studyabroadstudent.vocabularies.newprograms',
        required=False,
    )

    #######################################################
    model.fieldset(
        'step1',
        label=_(u'Step 1'),
        fields=['studentID'],
    )

    dexteritytextindexer.searchable('studentID')
    studentID = schema.TextLine(
        title=_(u'UW Oshkosh Student ID'),
        description=_(u'Do not include the initial "W" in the UW Oshkosh ID.  If you do not have a UW Oshkosh ID (current or past), leave this blank.'),  # noqa : E501
        required=False,
        constraint=validate_student_id,
        # TODO - write test_validate_student_id  # noqa : T000
    )

    #######################################################
    model.fieldset(
        'contact',
        label=_(u'Step1: Contact Information'),
        fields=[
            'mainPhone',
            'otherPhone',
            'otherContactService',
            'otherContactID',
            'localAddr',
            'localAddrApt',
            'localCity',
            'localState',
            'localZip',
            'homeAddr1',
            'homeAddrApt',
            'homeCity',
            'homeState',
            'homeZip',
            'homeCountry',
        ],
    )

    mainPhone = schema.TextLine(
        title=_(u'Main phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=True,
    )

    otherPhone = schema.TextLine(
        title=_(u'Other phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    widget(
        'otherContactService',
        onchange=u'javascript:otherContactServiceChanged(event)',
    )
    otherContactService = schema.Choice(
        title=_(u'Other Contact Service'),
        description=_(
            u'Select the service you use most often, '
            "or select 'No value' if you don't use any of these services.",
        ),
        required=False,
        vocabulary=socialmediaservice,
    )

    otherContactID = schema.TextLine(
        title=_(u'Other contact service username or ID'),
        description=_(u'Enter your username or ID for the service you chose above.'),  # noqa : E501
        required=False,
    )

    localAddr = schema.TextLine(
        title=_(u'Local Address: Street'),
        required=True,
    )

    localAddrApt = schema.TextLine(
        title=_(u'Local Address: Apartment Number'),
        required=False,
    )

    localCity = schema.TextLine(
        title=_(u'Local Address: City'),
        required=True,
    )

    localState = schema.TextLine(
        title=_(u'Local Address: State'),
        default=_(u'WI'),
        required=True,
    )

    localZip = schema.TextLine(
        title=_(u'Local Address: Zip Code'),
        default=_(u'54901'),
        required=True,
    )

    homeAddr1 = schema.TextLine(
        title=_(u'Home Address: Street'),
        required=True,
    )

    homeAddrApt = schema.TextLine(
        title=_(u'Home Address: Apartment Number'),
        required=False,
    )

    homeCity = schema.TextLine(
        title=_(u'Home Address: City'),
        description=_(u''),
        required=True,
    )

    homeState = schema.TextLine(
        title=_(u'Home Address: State/Province/Department'),
        description=_(u''),
        required=True,
    )

    homeZip = schema.TextLine(
        title=_(u'Home Address: Zip or Postal Code'),
        description=_(u''),
        required=True,
    )

    homeCountry = schema.Choice(
        title=_(u'Home Address: Country'),
        source=RegistryValueVocabulary('oiestudyabroadstudent.countries'),
        required=True,
    )

    #######################################################
    model.fieldset(
        'emergency_contact',
        label=_(u'Emergency Contact'),
        fields=[
            'emerg1fullname',
            'emerg1relationship',
            'emerg1mail_personal',
            'emerg1mail_work',
            'emerg1phone_main',
            'emerg1phone_other',
            'emerg2fullname',
            'emerg2relationship',
            'emerg2mail_personal',
            'emerg2mail_work',
            'emerg2phone_main',
            'emerg2phone_other',
            'emerg3fullname',
            'emerg3relationship',
            'emerg3mail_personal',
            'emerg3mail_work',
            'emerg3phone_main',
            'emerg3phone_other',
            'emerg4fullname',
            'emerg4relationship',
            'emerg4mail_personal',
            'emerg4mail_work',
            'emerg4phone_main',
            'emerg4phone_other',
        ],
    )

    widget(
        'emerg1fullname',
        onchange=u'javascript:emergencyFullNameChanged(event)',
    )
    emerg1fullname = schema.TextLine(
        title=_(u'1 Full Name'),
        required=False,
    )

    emerg1relationship = schema.Choice(
        title=_(u'1 Relationship to You'),
        required=False,
        vocabulary=contactrelationship,
    )

    emerg1mail_personal = schema.TextLine(
        title=_(u'1 Main Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg1mail_work = schema.TextLine(
        title=_(u'1 Other Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg1phone_main = schema.TextLine(
        title=_(u'1 Main Phone'),
        description=_(u'Strongly recommended.  Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    emerg1phone_other = schema.TextLine(
        title=_(u'1 Other Phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    ###############

    widget('emerg2fullname', onchange=u'javascript:fullNameChanged(event)')
    emerg2fullname = schema.TextLine(
        title=_(u'2 Full Name'),
        required=False,
    )

    emerg2relationship = schema.Choice(
        title=_(u'2 Relationship to You'),
        required=False,
        vocabulary=contactrelationship,
    )

    emerg2mail_personal = schema.TextLine(
        title=_(u'2 Main Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg2mail_work = schema.TextLine(
        title=_(u'2 Other Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg2phone_main = schema.TextLine(
        title=_(u'2 Main Phone'),
        description=_(u'Strongly recommended.  Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    emerg2phone_other = schema.TextLine(
        title=_(u'2 Other Phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    #############

    widget('emerg3fullname', onchange=u'javascript:fullNameChanged(event)')
    emerg3fullname = schema.TextLine(
        title=_(u'3 Full Name'),
        required=False,
    )

    emerg3relationship = schema.Choice(
        title=_(u'3 Relationship to You'),
        required=False,
        vocabulary=contactrelationship,
    )

    emerg3mail_personal = schema.TextLine(
        title=_(u'3 Main Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg3mail_work = schema.TextLine(
        title=_(u'3 Other Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg3phone_main = schema.TextLine(
        title=_(u'3 Main Phone'),
        description=_(u'Strongly recommended.  Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    emerg3phone_other = schema.TextLine(
        title=_(u'3 Other Phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    #############

    widget('emerg4fullname', onchange=u'javascript:fullNameChanged(event)')
    emerg4fullname = schema.TextLine(
        title=_(u'4 Full Name'),
        required=False,
    )

    emerg4relationship = schema.Choice(
        title=_(u'4 Relationship to You'),
        required=False,
        vocabulary=contactrelationship,
    )

    emerg4mail_personal = schema.TextLine(
        title=_(u'4 Main Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg4mail_work = schema.TextLine(
        title=_(u'4 Other Email'),
        description=_(u'Strongly recommended.  By typing in an email address here, you permit the UWO OIE to send non-emergency messages intended to update contacts about significant unanticipated events that have occurred or may occur and which have involved or may involve an increase in program risk.'),  # noqa : E501
        required=False,
        # write_permission="UWOshOIE: Modify revisable fields",
    )

    emerg4phone_main = schema.TextLine(
        title=_(u'4 Main Phone'),
        description=_(u'Strongly recommended.  Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    emerg4phone_other = schema.TextLine(
        title=_(u'4 Other Phone'),
        description=_(u'Include area code (and country code if the phone does not have a U.S. phone number).'),  # noqa : E501
        required=False,
    )

    #######################################################
    model.fieldset(
        'demographics',
        label=_(u'Demographics'),
        fields=[
            'ethnicity',
            'ethnicityOther',
            'stateResidency',
            'countrycitizenship',
            'immigrationStatus',
            'countryBirth',
            'dateOfBirth',
        ],
    )

    ethnicity = schema.Choice(
        title=_(u'Ethnicity'),
        description=_(u''),
        source=RegistryValueVocabulary('oiestudyabroadstudent.ethnicities'),
        required=False,
    )

    ethnicityOther = schema.TextLine(
        title=_(u'Ethnicity: Other'),
        description=_(u'Enter your ethnicity only if you selected "other" above.'),  # noqa : E501
        required=False,
    )

    stateResidency = schema.Choice(
        title=_(u'State of Residency'),
        description=_(u''),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.us_states_territories',
        ),
        required=True,
    )

    countrycitizenship = schema.Choice(
        title=_(u'Country of Citizenship'),
        source=RegistryValueVocabulary('oiestudyabroadstudent.countries'),
        required=True,
    )

    immigrationStatus = schema.Choice(
        title=_(u'Immigration Status'),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.immigration_status',
        ),
        required=True,
    )

    countryBirth = schema.Choice(
        title=_(u'Country of Birth'),
        source=RegistryValueVocabulary('oiestudyabroadstudent.countries'),
        required=True,
    )

    dateOfBirth = schema.Date(
        title=_(u'Date of Birth'),
        required=True,
    )

########################################################
    model.fieldset(
        'education',
        label=_(u'Education'),
        fields=[
            'educationLevel',
            'universityEnrolledUWO',
            'universityEnrolledOther',
            'major1',
            'major2',
            'minor1',
            'minor2',
            'graduationYear',
            'graduationMonth',
        ],
    )

    educationLevel = schema.Choice(
        title=_(u'Current Education Level'),
        source=RegistryValueVocabulary(
            'oiestudyabroadstudent.education_level',
        ),
        required=False,
    )

    universityEnrolledUWO = schema.Choice(
        title=_(u'Are you enrolled at UW Oshkosh?'),
        description=_(u''),
        vocabulary=yes_no_vocabulary,
        required=True,
    )

    universityEnrolledOther = schema.TextLine(
        title=_(u'If "School" is "OTHER"'),
        description=_(u'Type the official name of the school you are attending now only if you chose "No" above.'),  # noqa : E501
        required=False,
    )

    major1 = schema.Choice(
        title=_(u'First Major'),
        description=_(u'This must match the intended major on your STAR report.'),  # noqa : E501
        required=False,
        source=RegistryValueVocabulary('oiestudyabroadstudent.majors'),
    )

    major2 = schema.Choice(
        title=_(u'Second Major'),
        description=_(u'This must match the intended major on your STAR report.  If you don\'t have a second major, leave this blank.'),  # noqa : E501
        required=False,
        source=RegistryValueVocabulary('oiestudyabroadstudent.majors'),
    )

    minor1 = schema.TextLine(
        title=_(u'First Minor'),
        description=_(u'This must match the intended minor on your STAR report.  If you don\'t have a minor, leave this blank.'),  # noqa : E501
        required=False,
    )

    minor2 = schema.TextLine(
        title=_(u'Second Minor'),
        description=_(u'This must match the intended minor on your STAR report.  If you don\'t have a minor, leave this blank.'),  # noqa : E501
        required=False,
    )

    graduationYear = schema.Int(
        title=_(u'Graduation: Anticipated Year'),
        description=_(u'Enter the full 4-digit year.'),
        min=2018,
        max=2100,
        required=False,
    )

    graduationMonth = schema.Choice(
        title=_(u'Graduation: Anticipated Month'),
        description=_(u'Select the month that corresponds to your official graduation date.'),  # noqa : E501
        vocabulary=graduation_month_vocabulary,
        required=False,
    )

    #######################################################
    model.fieldset(
        'courses',
        label=_(u'Study Away Courses'),
        fields=['courses'],
    )

    courses = schema.List(
        title=_(u'Course Selection'),
        description=_(u'Request enrollment in study away courses.  Your selection must match advertised course options.'),  # noqa : E501
        value_type=schema.Choice(
            source=RegistryValueVocabulary(
                'oiestudyabroadstudent.course_subject_and_number',
            ),
        ),
    )

    #######################################################
    model.fieldset(
        'date',
        label=_(u'Dates'),
        fields=[
            'interviewDate',
            'prePostTravelClassDates',
            'orientationDeadline',
            'paymentDeadlines',
            'departureDate',
            'airportTransferDeparture',
            'departureModeOfTransportation',
            'returnDepartureDate',
            'returnModeOfTransportation',
            'airportTransferReturn',
            'requestToDeviateFromProgramDates',
                ],
    )

    interviewDate = schema.Date(
        title=_(u'Interview Date'),
        description=_(
            u'Contact the Program Liaison to schedule an interview.  Make your interview appointment and type your interview date here prior to submiting this application.  The actual interview date may or may not need to occur prior to the STEP II application deadline.  This will be determined by the Program Liaison.'),  # noqa : E501
        required=False,
    )

    prePostTravelClassDates = schema.Choice(
        title=_(u'Confirm Attendance at Pre- & Post-travel Program-specific Sessions'),  # noqa : E501
        description=_(
            u'Select ''Yes'' to confirm that you will attend all advertised pre- or post-travel sessions.  Select ''No'' if you have a conflict on one or more dates.'),  # noqa : E501
        vocabulary=yes_no_vocabulary,
        required=True,
        # TODO insert date from program object; Displays only if there are dates in "Pretravel Class & Orientation Dates" or "Post-travel Class Dates" in the MGMT PORTAL.  # noqa : E501
    )

    orientationDeadline = schema.Choice(
        title=_(u'Orientation Submission Deadline'),
        description=_(
            u'I understand that the Office of International Education deadline for submission of orientation materials is a final deadline.  I understand and agree that all Office of International Education orientation requirements must be completed by this date.  If I forsee conflicts with this date, I will complete requirements in advance of this date.  If not completed by this date, I understand and agree that the Office of International Education will begin the process of removing me from my program and that the Withdrawal & Refund Policy will apply.'),  # noqa : E501
        vocabulary=yes_no_vocabulary,
        required=True,
    )

    paymentDeadlines = schema.Choice(
        title=_(u'Payment Deadlines'),
        description=_(
            u'I understand that the payment deadlines are final deadlines and that it is my responsibility to record these dates in my calendar.  I understand that all payments must be made in full by the deadlines, or I must submit the "Notice of Financial Aid Award for Study Abroad/Away" form if making my payments using financial aid, a scholarship that I have already received, veterans benefits or an outside loan.  If not submitted by this date, I understand that the Office of International Education will begin the process of removing me from my program and that the Withdrawal & Refund Policy will apply.'),  # noqa : E501
        vocabulary=yes_no_vocabulary,
        required=True,
    )

    departureDate = schema.Date(
        title=_(u'Program Departure Date'),
        description=_(u'will appear only when "transfer provided" is selected on the "program workflow"'),  # noqa : E501
        required=False,
        # TODO insert date from program object when in transfer provided state  # noqa : E501
    )

    airportTransferDeparture = schema.Choice(
        title=_(u'Confirm Departure from Oshkosh (or alternative city)'),
        description=_(u''),
        vocabulary=departure_transfer_vocabulary,
        required=False,
        # TODO this should appear only when "transfer provided" is selected  # noqa : E501
        #  on the "program workflow"
    )

    departureModeOfTransportation = schema.Choice(
        title=_(u'Confirm Flight'),
        description=_(u''),
        vocabulary=departure_mode_transportation_vocabulary,
        required=False,
        # TODO this should appear only when "transfer provided" is selected  # noqa : E501
        #  on the "program workflow"
    )

    returnDepartureDate = schema.Date(
        title=_(u'Program Return Date'),
        description=_(u'will appear only when "transfer provided" is selected on the "program workflow"'),  # noqa : E501
        required=False,
        # TODO insert date from program object when in transfer provided state  # noqa : E501
    )

    returnModeOfTransportation = schema.Choice(
        title=_(u'Return-Mode of Transportation'),
        description=_(u'Choose one'),
        vocabulary=return_mode_transportation_vocabulary,
        required=False,
        # TODO this should appear only when "transfer provided" is selected  # noqa : E501
        #  on the "program workflow"
    )

    airportTransferReturn = schema.Choice(
        title=_(u'Confirm Return to Oshkosh (or alternative city)'),
        description=_(u''),
        vocabulary=return_transfer_vocabulary,
        required=False,
        # TODO this should appear only when "transfer provided" is selected  # noqa : E501
        #  on the "program workflow"
    )

    requestToDeviateFromProgramDates = schema.Choice(
        title=_(u'Request to Deviate from Program Dates'),
        description=_(u'Select ''Yes'' once you have printed, read, signed and uploaded this PDF'),  # noqa : E501
        vocabulary=yes_no_vocabulary,
        required=False,
        # TODO need link to the PDF document  # noqa : E501
        # currently 'https://www.uwosh.edu/oie/away/documents/deviationletter.pdf/view'  # noqa : E501
    )

    #######################################################
    model.fieldset(
        'financial_aid',
        label=_(u'Financial Aid'),
        fields=[],
    )

    #######################################################
    model.fieldset(
        'shortanswerquestions',
        label=_(u'Short Answer Questions'),
        fields=[
            'applicant_question_text1',
            'applicant_question_answer1',
            'applicant_question_text2',
            'applicant_question_answer2',
            'applicant_question_text3',
            'applicant_question_answer3',
            'applicant_question_text4',
            'applicant_question_answer4',
            'applicant_question_text5',
            'applicant_question_answer5',
        ],
    )

    applicant_question_text1 = schema.Text(
        title=u'Applicant Question 1',
        description=u'',
        default=u'If this help text appears, you may skip this question. This program does not require a response.',  # noqa : E501
        required=False,
    )

    applicant_question_answer1 = schema.Text(
        title=u'Answer 1',
        description=u'If a question appears under Applicant Question 1 above, type your response here.',  # noqa : E501
        required=False,
    )

    applicant_question_text2 = schema.Text(
        title=u'Applicant Question 2',
        description=u'',
        default=u'If this help text appears, you may skip this question. This program does not require a response.',  # noqa : E501
        required=False,
    )

    applicant_question_answer2 = schema.Text(
        title=u'Answer 2',
        description=u'If a question appears under Applicant Question 2 above, type your response here.',  # noqa : E501
        required=False,
    )

    applicant_question_text3 = schema.Text(
        title=u'Applicant Question 3',
        description=u'',
        default=u'If this help text appears, you may skip this question. This program does not require a response.',  # noqa : E501
        required=False,
    )
    applicant_question_answer3 = schema.Text(
        title=u'Answer 3',
        description=u'If a question appears under Applicant Question 3 above, type your response here.',  # noqa : E501
        required=False,
    )

    applicant_question_text4 = schema.Text(
        title=u'Applicant Question 4',
        description=u'',
        default=u'If this help text appears, you may skip this question. This program does not require a response.',  # noqa : E501
        required=False,
    )

    applicant_question_answer4 = schema.Text(
        title=u'Answer 4',
        description=u'If a question appears under Applicant Question 4 above, type your response here.',  # noqa : E501
        required=False,
    )
    applicant_question_text5 = schema.Text(
        title=u'Applicant Question 5',
        description=u'',
        default=u'If this help text appears, you may skip this question. This program does not require a response.',  # noqa : E501
        required=False,
    )

    applicant_question_answer5 = schema.Text(
        title=u'Answer 5',
        description=u'If a question appears under Applicant Question 5 above, type your response here.',  # noqa : E501
        required=False,
    )
    #######################################################

    model.fieldset(
        'background',
        label=_(u'Background'),
        description=_(u'If you are required to apply for advance permission (a visa) to enter one or more of your host countries, your visa application may require you to disclose citations, convictions and/or arrests in a criminal record.'),  # noqa : E501
        fields=[],
    )
    #######################################################

    model.fieldset(
        'release',
        label=_(u'Release'),
        fields=[
            'UWOshkoshRelease',
            'certification',
        ],
    )
    #######################################################

    model.fieldset(
        'forms',
        label=_(u'STEP II Forms'),
        description=_(u'To complete STEP II, print relevant documents, clearly print your responses, sign forms by hand where indicated, and follow instructions below.  Signatures cannot be typed.'),  # noqa : E501
        fields=[
            'applicationFeeOK',
            'disciplinary_clearance_form_link',
            'disciplinary_clearance_form_uploaded_file',
            'specialStudentFormOK',
            'state_of_wisconsin_need_based_travel_grant_form_link',
            'state_of_wisconsin_need_based_travel_grant_form_uploaded_file',
            'special_student_form_for_undergraduate_admissions_form_link',
            'special_student_form_for_undergraduate_admissions_uploaded_file',
            'transcriptsOK',
            'UWOshkoshStatementOK',
            'UWSystemStatementOK',
            'withdrawalRefund',
            'cumulativeGPA',
        ],
    )

    disciplinary_clearance_form_link = RichText(
        title=u'Disciplinary Clearance Form',
        description=u'Download this PDF, fill it out, and upload it below',
        required=False,
        defaultFactory=get_url_disciplinary_clearance_form,
    )

    disciplinary_clearance_form_uploaded_file = field.NamedFile(
        title=u'Disciplinary Clearance Form',
        description=u'Upload your filled-out copy of the form',
        required=False,
    )

    state_of_wisconsin_need_based_travel_grant_form_link = RichText(
        title=u'State of Wisconsin Need-based Travel Grant Form',
        description=u'Download this PDF, fill it out, and upload it below',
        required=False,
        defaultFactory=get_url_special_student_form,
    )

    state_of_wisconsin_need_based_travel_grant_form_uploaded_file = \
        field.NamedFile(
            title=u'State of Wisconsin Need-based Travel Grant Submission',
            description=u'Upload your completed form.',
            required=False,
        )

    special_student_form_for_undergraduate_admissions_form_link = RichText(
        title=u'Special/Non-degree Registration-Undergraduate Level',
        description=u'Download this form, fill it out, and upload it below.',
        required=False,
        defaultFactory=get_url_special_student_form_for_undergraduate_admissions_form,  # noqa : E501
        # TODO appears when "Special/Non-Degree Registration-Graduate Level"  # noqa : E501
        #  is checked "yes" in the MGMT PORTAL
        #   AND
        #   "Current Education Level" is NOT "graduate school"
        #   AND
        #   the course request in the PART PORTAL includes at least one course
        #   numbered 500-799.
        #   OR
        #   appears when "Special/Non-Degree Registration-Graduate Level" is
        #   checked "yes" in the MGMT PORTAL
        #   AND
        #   "Current Education Level" IS "graduate school"
        #   AND
        #   the course request in the PART PORTAL includes at least one course
        #   numbered 100-499.
    )

    special_student_form_for_undergraduate_admissions_uploaded_file = \
        field.NamedFile(
            title=u'Special/Non-degree Registration-Undergraduate Level Submission',  # noqa : E501
            description=u'Upload your completed form.',
            required=False,
        )

    cumulativeGPA = schema.Float(
        title=_(u'Cumulative GPA'),
        description=_(u'Type the applicant''s CURRENT CUMULATIVE GPA exactly as it appears on the unofficial transcript.'),  # noqa : E501
        required=False,
    )

    #######################################################
    model.fieldset(
        'stepiii_documentation',
        label=_(u'Documentation'),
        description=_(u'Step 3 Documentation'),
        fields=[
            'transferCreditForm_link',
            'transferCreditSubmission',
            'transferCreditVerified',
        ],
    )

    #######################################################
    model.fieldset(
        'stepiii_identification',
        label=_(u'Step 3 Identification'),
        description=_(u'Complete the following using information from your unexpired passport (required for international travel) or with your unexpired driver\'s license (for domestic travel only).'),  # noqa : E501
        fields=[
            'travelDocLast',
            'travelDocFirst',
            'travelDocMiddle',
            'travelDocSex',
            'travelDocNumber',
            'travelDocExpiration',
            'passportReceipt',
            'passportOK',
            'driversLicenseReceipt',
            'driversLicenseReceiptVerified',
            'photoPaperOfficial',
            'photoPaperOfficialVerified',
            'photoDigitalOfficial',
            'photoDigitalOfficialVerified',
            'photoPaper',
            'photoPaperVerified',
            'photoDigital',
            'photoDigitalVerified',
        ],
    )

    #######################################################
    model.fieldset(
        'stepiii_fecop',
        label=_(u'STEP 3 FECOP'),
        description=_(u'Financial'),
        fields=[
            'fecop_label',
            'fecop_link',
            'fecopSubmission',
            'fecopVerified',
        ],
    )

    #######################################################
    model.fieldset(
        'stepiii_lifestyle',
        label=_(u'STEP 3 Lifestyle'),
        fields=[
            'isVegetarian',
            'smokingPreferred',
        ],
    )

    #######################################################
    model.fieldset(
        'stepiii_health',
        label=_(u'STEP 3 Health'),
        fields=[
            'medicalReadStatement',
            'medicalHealthProblems_whatCondition',
            'medicalHealthProblems_stable',
            'medicalHealthProblems',
            'healthConditionsSurgeriesYesNo',
            'healthConditionsSurgeriesDetails',
            'medicalHealthProblems_underCare',
            'wheelchair',
            'assistiveDevice',
            'assistiveDeviceOnFlight',
            'assistiveDeviceList',
            'hasDifficultyWalking',
            'maxWalkingDistance',
            'stairsMax',
            'walkingClimbingDescription',
            'sight',
            'healthPhysicalAdditionalInfoYesNo',
            'additionalNeeds',
            'medicalRegistered',
            'medicalRegistered_office',
            'medicalRegistered_accommodations',
            'medicalHealthProblems_additionalInfo',
            'medicalMentalProblems_enoughMedication',
            'medicalMentalProblems_stable',
            'medicalAccessOK',
            'healthMeetingNotes',
        ],
    )

    # healthConfirmation_label = schema.TextLine(
    #     title=_(u'I understand and agree'),
    # )

    #######################################################
    model.fieldset(
        'stepiii_allergies_and_medication',
        label=_(u'STEP 3 Allergies & Medications'),
        fields=[
            'allergiesYesNo',
            'foodAllergies',
            'medications_label',
            'medicalHealthProblems_takenMedication',
            'medicalHealthProblems_willingToPrescribe',
            'medicalHealthProblems_medications',
            'medicationsStorage',
        ],
    )

    #######################################################
    model.fieldset(
        'stepiii_roommate',
        label=_(u'STEP III Roommate'),
        description=_(u'If you are not traveling with a UW Oshkosh student group, do not list a roommate choice.  If you are traveling on a group program, list your first and second choice roommates here.  Any roommate you request must list you on his/her application in return.'),  # noqa : E501
        fields=[
            'roommateName1',
            'roommateName2',
        ],
    )
Exemplo n.º 18
0
class IPersona(model.Schema, IDesignPloneContentType):
    """Marker interface for contenttype Persona"""

    foto_persona = field.NamedImage(
        title=_("foto_persona_label", default="Foto della persona"),
        required=False,
        description=_(
            "foto_persona_help",
            default="Foto da mostrare della persona. "
            "La dimensione suggerita è 180x100 px.",
        ),
    )
    ruolo = schema.Choice(
        title=_("ruolo_label", default="Ruolo"),
        description=_(
            "ruolo_help",
            default="Seleziona il ruolo della persona tra quelli disponibili.",
        ),
        vocabulary="design.plone.contenttypes.RuoliPersona",
        required=True,
    )

    organizzazione_riferimento = RelationList(
        title=_(
            "organizzazione_riferimento_label",
            default="Organizzazione di riferimento",
        ),
        description=_(
            "organizzazione_riferimento_help",
            default="Seleziona una lista di organizzazioni a cui la persona"
            " appartiene.",
        ),
        value_type=RelationChoice(
            title=_("Organizzazione di riferimento"),
            vocabulary="plone.app.vocabularies.Catalog",
        ),
        default=[],
        required=False,
    )

    data_conclusione_incarico = schema.Date(
        title=_(
            "data_conclusione_incarico_label",
            default="Data conclusione incarico",
        ),
        description=_(
            "data_conclusione_incarico_help",
            default="Data di conclusione dell'incarico.",
        ),
        required=False,
    )

    competenze = BlocksField(
        title=_("competenze_label", default="Competenze"),
        description=_(
            "competenze_help",
            default="Descrizione del ruolo e dei compiti della persona.",
        ),
        required=False,
    )
    deleghe = BlocksField(
        title=_("deleghe_label", default="Deleghe"),
        description=_(
            "deleghe_help",
            default="Elenco delle deleghe a capo della persona.",
        ),
        required=False,
    )

    tipologia_persona = schema.Choice(
        title=_("tipologia_persona_label", default="Tipologia persona"),
        description=_(
            "tipologia_persona_help",
            default="Seleziona la tipologia di persona: politica,"
            " amministrativa o di altro tipo.",
        ),
        vocabulary="design.plone.contenttypes.TipologiaPersona",
        required=True,
    )

    data_insediamento = schema.Date(
        title=_("data_insediamento_label", default="Data insediamento"),
        description=_(
            "data_insediamento_help",
            default="Solo per persona politica: specificare la data di"
            " insediamento.",
        ),
        required=False,
    )

    biografia = BlocksField(
        title=_("biografia_label", default="Biografia"),
        description=_(
            "biografia_help",
            default="Solo per persona politica: testo descrittivo che riporta"
            " la biografia della persona.",
        ),
        required=False,
    )

    telefono = schema.List(
        title=_("telefono_persona_label", default="Numero di telefono"),
        description=_(
            "telefono_persona_help",
            default="Contatto telefonico della persona. E' possibile inserire "
            'più di un numero. Premendo "Invio" o "tab" si può passare al '
            "successivo da inserire.",
        ),
        value_type=schema.TextLine(),
        missing_value=[],
        default=[],
        required=False,
    )
    fax = schema.TextLine(
        title=_("fax_persona_label", default="Fax"),
        description=_("fax_persona_help",
                      default="Indicare un numero di fax."),
        required=False,
    )
    email = schema.List(
        title=_("email_persona_label", default="Indirizzo email"),
        description=_(
            "email_persona_help",
            default="Contatto mail della persona. E' possibile inserire più"
            ' di un indirizzo. Premendo "Invio" o "tab" si può passare al '
            "successivo da inserire.",
        ),
        value_type=schema.TextLine(),
        missing_value=[],
        default=[],
        required=False,
    )
    curriculum_vitae = field.NamedBlobFile(
        title=_("curriculum_vitae_label", default="Curriculum vitae"),
        required=False,
        description=_(
            "curriculum_vitae_help",
            default=
            "Allega un file contenente il curriculum vitae della persona. "
            "Se ha più file da allegare, utilizza questo campo per quello principale "
            'e gli altri mettili dentro alla cartella "Curriculum vitae" che troverai dentro alla Persona.',
        ),
    )

    atto_nomina = field.NamedFile(
        title=_("atto_nomina_label", default="Atto di nomina"),
        required=False,
        description=_(
            "atto_nomina_help",
            default="Inserire un file contenente l'atto di nomina della"
            " persona.",
        ),
    )

    # custom widgets
    form.widget(
        "organizzazione_riferimento",
        RelatedItemsFieldWidget,
        vocabulary="plone.app.vocabularies.Catalog",
        pattern_options={
            "maximumSelectionSize": 10,
            "selectableTypes": ["UnitaOrganizzativa"],
        },
    )

    # custom fieldsets
    model.fieldset(
        "ruolo",
        label=_("ruolo_label", default="Ruolo"),
        fields=[
            "ruolo",
            "organizzazione_riferimento",
            "data_conclusione_incarico",
            "competenze",
            "deleghe",
            "tipologia_persona",
            "data_insediamento",
            "biografia",
        ],
    )
    model.fieldset(
        "contatti",
        label=_("contatti_label", default="Contatti"),
        fields=["telefono", "fax", "email"],
    )
    model.fieldset(
        "documenti",
        label=_("documenti_label", default="Documenti"),
        fields=["curriculum_vitae", "atto_nomina"],
    )
    # SearchableText fields
    dexteritytextindexer.searchable("ruolo")
    dexteritytextindexer.searchable("competenze")
    dexteritytextindexer.searchable("deleghe")
    dexteritytextindexer.searchable("tipologia_persona")
    dexteritytextindexer.searchable("telefono")
    dexteritytextindexer.searchable("fax")
    dexteritytextindexer.searchable("email")