def update_meeting_schema(baseSchema): specificSchema = Schema((DataGridField( name='sections', widget=DataGridField._properties['widget']( description="Commissions", description_msgid="commissions_descr", condition= "python: here.portal_type in ('MeetingCouncil', 'MeetingZCouncil')", columns={ 'name_section': SelectColumn("Commission name", vocabulary="listSections", col_description="Select the commission name."), 'date_section': Column("Commission date", col_description="Enter valid from date, " "use following format : DD/MM/YYYY."), }, label='Commissions', label_msgid='MeetingSeraing_label_commissions', i18n_domain='PloneMeeting', ), allow_oddeven=True, write_permission="Modify portal content", columns=('name_section', 'date_section'), allow_empty_rows=False, ), ), ) completeSchema = baseSchema + specificSchema.copy() baseSchema[ 'notes'].widget.description_msgid = "MeetingSeraing_descr_meeting_notes" baseSchema[ 'notes'].widget.label_msgid = "MeetingSeraing_msgid_meeting_notes" return completeSchema
), ), DataGridField('curriculum', description='Estas informações serão apresentadas em seu cartão de visita virtual.', columns=('tipo', 'course', 'inst'), allow_empty_rows = False, allow_oddeven=True, allow_reorder = False, fixed_rows = [ FixedRow(keyColumn="course", initialData = { "tipo" : "", "course" : "Medicina", "inst" : "" }), ], widget=DataGridWidget( label='Curriculum', columns={ 'tipo' : SelectColumn('Tipo', vocabulary='getCourseTypes'), 'course' : Column('Área'), 'inst' : Column('Instituição'), }, ), ), )) set_schemata_properties(MAIN, schemata='Principal') PASSWORD = Schema(( StringField('password', validators = ('isCurrentPassword',), widget=PasswordWidget( label='Senha Atual', condition='python:object.showPasswordCondition()',
label_msgid='indicators_label_priority_data_flows', i18n_domain='indicators', ), ), DataGridField( name='codes', widget=DataGridWidget( label="Identification codes", description= "Codes are short names used to identify the indicator" " in question. Code is made up of a SET-ID and an " "CODE-NR, e.g. TERM 002. Multiple codes are allowed, " "since same indicator can be re-used in other " "indicators' sets.", columns={ 'set': SelectColumn("Set ID", vocabulary="get_indicator_codes"), "code": Column("Code number") }, auto_insert=False, label_msgid='indicatorsfactsheet_label_codes', i18n_domain='indicators', ), columns=("set", "code"), required_for_published=True, searchable=True, ), EEAReferenceField( 'relatedItems', relationship='relatesTo', multiValued=True, isMetadata=False,
"to clean up form input. " "If the return value is None then the adapter will use request.form " "If the return value is a dictionary then the adapter will use the " "returned dictionary. " "PLEASE NOTE: errors in the evaluation of this expression will " "cause an error on form display."), size=70, ), ), DataGridField( name='field_map', widget=DataGridWidget( label=u'Field Map', description=u"Map the PFG field to the Sharepoint list column.", columns={ 'pfg_field': SelectColumn(u'PFG Field', vocabulary='fgFieldsDisplayList',), 'sharepoint_column': SelectColumn(u'Sharepoint Column', vocabulary='getColumnsVocab'), }, ), allow_empty_rows=False, required=False, columns=('pfg_field', 'sharepoint_column'), ), #DataGridField( # name='upload_field_map', # widget=DataGridWidget( # label=u'Field Map', # description=u"Map the PFG field to the Sharepoint list column.", # columns={
relationship='Owns', widget=ReferenceWidget( label=_('Review of Systems'), macro='ros_reference', ), ), DataGridField( 'allergies', columns=('allergy', 'reaction'), allow_empty_rows=False, allow_oddeven=True, widget=DataGridWidget( label=_('Allergies'), columns={ 'allergy': Column('Alergia'), 'reaction': SelectColumn('Reação', vocabulary='getReactionValues'), }, ), ), #DataGridField('medication_taken', #columns=('medication', 'mg', 'use', 'start'), #allow_empty_rows = False, #allow_oddeven=True, #widget=DataGridWidget( #label=_('Medicamentos em uso'), #columns={ #'medication' : Column('Medicamento'), #'mg' : Column('Concentração'), #'use' : Column('Uso'), #'start' : Column('Data', default=DateTime().strftime('%d/%m/%Y')),
'settimana_tipo', storage=atapi.AnnotationStorage(), columns=('giorno', 'inizio_m', 'end_m', 'inizio_p', 'end_p'), fixed_rows="vocGiorniSettimana", allow_delete=False, allow_insert=False, allow_reorder=False, widget=DataGridWidget( label=_(u"Settimana Tipo"), description=_(u"Indicare la composizione della settimana tipo"), columns={ "giorno": FixedColumn("Giorno"), "inizio_m": SelectColumn("Ora inizio mattina", vocabulary="vocOreInizio", default=""), "end_m": SelectColumn( "Ora fine mattina", vocabulary="vocOreInizio", default=""), "inizio_p": SelectColumn("Ora inizio pomeriggio", vocabulary="vocOreInizio", default=""), "end_p": SelectColumn("Ora fine pomeriggio", vocabulary="vocOreInizio", default=""), }), required=True, ),
description="AsCopyGroupOn", description_msgid="as_copy_group_on_descr", label='Ascopygroupon', label_msgid='PloneMeeting_label_asCopyGroupOn', i18n_domain='PloneMeeting', ), write_permission="PloneMeeting: Write risky config", ), DataGridField( name='certifiedSignatures', widget=DataGridField._properties['widget']( columns={ 'signatureNumber': SelectColumn( "Certified signatures signature number", vocabulary="listSignatureNumbers", col_description= "Select the signature number, keep signatures ordered by number." ), 'name': Column( "Certified signatures signatory name", col_description= "Name of the signatory (for example 'Mister John Doe')."), 'function': Column("Certified signatures signatory function", col_description= "Function of the signatory (for example 'Mayor')."), 'date_from': Column( "Certified signatures valid from (included)", col_description=
allow_insert=False, allow_reorder=False, widget=DataGridWidget( label='Form fields to Salesforce fields mapping', label_msgid="label_salesforce_field_map", description="""The following Form Fields are available\ within your Form Folder. Choose the appropriate \ Salesforce Field for each Form Field.""", description_msgid='help_salesforce_field_map', columns={ "field_path": FixedColumn("Form Field (path)", visible=False), "form_field": FixedColumn("Form Field"), "sf_field": SelectColumn("Salesforce Field", vocabulary="buildSFFieldOptionList") }, i18n_domain="salesforcepfgadapter", ), ), DataGridField( 'presetValueMap', searchable=0, required=0, read_permission=ModifyPortalContent, schemata='field mapping', columns=('value', 'sf_field'), allow_delete=True, allow_insert=True, allow_reorder=False, widget=DataGridWidget(
class DataGridDemoType2(atapi.BaseContent): """ Demo for different DataGridWidget columns This class is used in unit testing Check manual that: - Rows are inserted automatically when a value is filled in - Select column has sample 2 as a default value """ security = ClassSecurityInfo() schema = atapi.BaseSchema + atapi.Schema(( DataGridField( 'AutoInsertDemoField', searchable=True, # One unit tests checks whether text search works columns=("column1", "column2", "column3"), allow_empty_rows= False, # Must be false to make auto insert feature perform correctly widget=DataGridWidget( auto_insert=True, description= "Automatically insert new rows when the last row is being filled. When you edit the last row, a new row is created automatically.", description_msgid='DataGridDemoType_help_AutoInsertRows', i18n_domain='datagridfield', columns={}, ), ), DataGridField( 'DemoField2', searchable=True, # One unit tests checks whether text search works columns=("column1", "column2", "select_sample"), widget=DataGridWidget( description= "Set default values for created rows. Choose SelectColumn value from the default dictionary", description_msgid='DataGridDemoType_help_DemoField2', i18n_domain='datagridfield', columns={ 'column1': Column(_(u"Toholampi city rox")), 'column2': Column(_(u"My friendly name"), default=_(u"Some default text")), 'select_sample': SelectColumn(_(u"Friendly name"), vocabulary="getSampleVocabulary", default="sample2") }, ), ), DataGridField( 'DemoField3', columns=("column1", "column2"), widget=DataGridWidget( description="Test radio and checkbox columns", description_msgid='DataGridDemoType_help_DemoField3', i18n_domain='datagridfield', columns={ 'column1': RadioColumn("Radio column", vocabulary="getSampleVocabulary"), 'column2': CheckboxColumn("Checkbox column") }, ), ), DataGridField( 'DemoField4', columns=("text_column", "help_column"), widget=DataGridWidget( description="Help column test", description_msgid='DataGridDemoType_help_DemoField4', i18n_domain='datagridfield', columns={ 'text_column': Column("Text column"), # Help is help.pt 'help_column': HelpColumn("Help", _(u"See help here"), "help", "info.gif") }, ), ), )) meta_type = portal_type = archetype_name = 'DataGridDemoType2' def getSampleVocabulary(self): """Get a sample vocabulary """ return atapi.DisplayList(( ( "sample", _(u"Sample value 1"), ), ( "sample2", _(u"Sample value 2"), ), ))
class DataGridDemoType2(atapi.BaseContent): """ Demo for different DataGridWidget columns This class is used in unit testing Check manual that: - Rows are inserted automatically when a value is filled in - Select column has sample 2 as a default value """ security = ClassSecurityInfo() schema = atapi.BaseSchema + atapi.Schema(( DataGridField('AutoInsertDemoField', searchable=True, # One unit tests checks whether text search works columns=("column1", "column2", "column3"), allow_empty_rows = False, # Must be false to make auto insert feature perform correctly widget = DataGridWidget( auto_insert = True, description="Automatically insert new rows when the last row is being filled. When you edit the last row, a new row is created automatically.", description_msgid='DataGridDemoType_help_AutoInsertRows', i18n_domain='datagridfield', columns={ }, ), ), DataGridField('DemoField2', searchable=True, # One unit tests checks whether text search works columns=("column1", "column2", "select_sample"), widget = DataGridWidget( description="Set default values for created rows. Choose SelectColumn value from the default dictionary", description_msgid='DataGridDemoType_help_DemoField2', i18n_domain='datagridfield', columns={ 'column1' : Column(_(u"Toholampi city rox"), required=True, col_description=_(u"Go Toholampi or go home.")), 'column2' : Column(_(u"My friendly name"), default=_(u"Some default text")), 'select_sample' : SelectColumn(_(u"Friendly name"), vocabulary="getSampleVocabulary", default="sample2") }, ), ), DataGridField('DemoField3', columns=("column1", "column2"), widget = DataGridWidget( description="Test radio and checkbox columns", description_msgid='DataGridDemoType_help_DemoField3', i18n_domain='datagridfield', columns={ 'column1' : RadioColumn("Radio column", vocabulary="getSampleVocabulary"), 'column2' : CheckboxColumn("Checkbox column") }, ), ), DataGridField('DemoField4', columns=("text_column", "help_column"), widget = DataGridWidget( description="Help column test", description_msgid='DataGridDemoType_help_DemoField4', i18n_domain='datagridfield', columns={ 'text_column' : Column("Text column"), # Help is help.pt 'help_column' : HelpColumn("Help", _(u"See help here"), "help", "info.png") }, ), ), DataGridField('DemoField5', columns=("link_column",), widget = DataGridWidget( description="Set of links", columns={ 'link_column' : LinkColumn("Link column"), }, ), ), DataGridField('DemoField6', columns=("date_column",), widget = DataGridWidget( description="date column", columns={ 'date_column' : DateColumn("Date column"), }, ), ), DataGridField('DemoField7', columns=("datetime_column",), widget = DataGridWidget( description="datetime column", columns={ 'datetime_column' : DatetimeColumn("Datetime column"), }, ), ), DataGridField('DemoField8', columns=("datetimelocal_column",), widget = DataGridWidget( description="datetime column, local time zone", columns={ 'datetimelocal_column' : DatetimeLocalColumn("DatetimeLocal column"), }, ), ), DataGridField('DemoField9', columns=("file_column",), widget = DataGridWidget( description="file column", columns={ 'file_column' : FileColumn("File column"), }, ), ), DataGridField('DemoField10', columns=("email_column",), widget = DataGridWidget( description="email column", columns={ 'email_column' : EmailColumn("Email column"), }, ), ), DataGridField('DemoField11', columns=("color_column",), widget = DataGridWidget( description="color column", columns={ 'color_column' : ColorColumn("Color column"), }, ), ), DataGridField('DemoField12', columns=("password_column",), widget = DataGridWidget( description="password column", columns={ 'password_column' : PasswordColumn("Password column"), }, ), ), DataGridField('DemoField13', columns=("range_column",), widget = DataGridWidget( description="range column", columns={ 'range_column' : RangeColumn("Range column"), }, ), ), DataGridField('DemoField14', columns=("month_column",), widget = DataGridWidget( description="month column", columns={ 'month_column' : MonthColumn("Month column"), }, ), ), DataGridField('DemoField15', columns=("search_column",), widget = DataGridWidget( description="search column", columns={ 'search_column' : SearchColumn("Search column"), }, ), ), DataGridField('DemoField16', columns=("time_column",), widget = DataGridWidget( description="time column", columns={ 'time_column' : TimeColumn("Time column"), }, ), ), DataGridField('DemoField17', columns=("url_column",), widget = DataGridWidget( description="url column", columns={ 'url_column' : UrlColumn("Url column"), }, ), ), DataGridField('DemoField18', columns=("week_column",), widget = DataGridWidget( description="week column", columns={ 'week_column' : WeekColumn("Week column"), }, ), ), )) meta_type = portal_type = archetype_name = 'DataGridDemoType2' def getSampleVocabulary(self): """Get a sample vocabulary """ return atapi.DisplayList( (("sample", _(u"Sample value 1"),), ("sample2", _(u"Sample value 2"),),))
), # other names DataGridField( 'xpcm_contact_otherNames', searchable=True, required=False, columns=('name_type', 'name'), allow_empty_rows=False, widget=DataGridWidget( label=u'Other Names', auto_insert=False, description="Other Names for This Person", columns={ 'name_type': SelectColumn("Name Type", vocabulary="vocabulary_contactMetadata"), 'name': Column("Other Names") }, ), schemata='Contact', ), # telephone numbers DataGridField( 'xpcm_contact_phones', searchable=True, required=False, columns=('phone_type', 'phone_number'), allow_empty_rows=False, widget=DataGridWidget(
DataGridField( 'settimana_tipo', storage=atapi.AnnotationStorage(), columns=('giorno', 'inizio_m', 'num_m', 'inizio_p', 'num_p'), fixed_rows="vocGiorniSettimana", allow_delete=False, allow_insert=False, allow_reorder=False, widget=DataGridWidget( label=_(u"Settimana Tipo"), description=_(u"Indicare la composizione della settimana tipo"), columns={ "giorno": FixedColumn("Giorno"), "inizio_m": SelectColumn( "Ora inizio", vocabulary="vocOreInizio", default=""), "num_m": SelectColumn("Numero appuntamenti", vocabulary="vocNumeroAppuntamenti", default=""), "inizio_p": SelectColumn( "Ora inizio", vocabulary="vocOreInizio", default=""), "num_p": SelectColumn("Numero appuntamenti", vocabulary="vocNumeroAppuntamenti", default=""), }), required=True, ), atapi.LinesField(
""" implements(IVocabulary) def getDisplayList(self, instance): """getDisplayList """ voc_fact = queryUtility(IVocabularyFactory, OrganisationsVocabulary) items = [(t.value, t.title or t.token) for t in voc_fact(instance)] items.insert(0, ('', '')) vocabulary = DisplayList(items) return vocabulary tmpOrganisationsVocabulary = ArchetypesOrganisationsVocabulary() OwnerColumn = SelectColumn("Owner", required=False, vocabulary=tmpOrganisationsVocabulary, default='') widget_helper_js = ( '++resource++eea.daviz.datasource.js', 'datagridwidget.js', 'selectautocomplete_widget.js', ) except ImportError: logger = logging.getLogger('eea.daviz') logger.warn('eea.dataservice is not installed') OrganisationsWidget = StringWidget OrganisationsVocabulary = None OwnerColumn = Column("Owner", required=True) widget_helper_js = ( '++resource++eea.daviz.datasource.js', 'datagridwidget.js',
allow_insert=True, allow_reorder=True, columns=('form', 'content'), widget=DataGridWidget( label=_('field_mapping_label', default=u'Field mapping'), description=_('field_mapping_help', default=u'Map form fields to field of the ' u'selected content type. Please note, ' u'that you must first select the ' u'content type, then save this adapter, ' u"and only then you'll be able to see the " u'fields of the selected content type.'), columns={ 'form': SelectColumn(_('field_mapping_form_label', default=u'Select a form field'), vocabulary='listFormFields'), 'content': SelectColumn(_('field_mapping_content_label', default=u'to be mapped to a content field.'), vocabulary='listContentFields') }, )), atapi.StringField( 'workflowTransition', required=False, write_permission=ModifyPortalContent, read_permission=ModifyPortalContent, storage=atapi.AnnotationStorage(), searchable=False, vocabulary='listTransitions',
), # This field is used # if invitations are allowed, and users enforced: to hold invitations, else hidden # if gcommons.Users not installed, to hold users DataGridField( name='unregisteredRelators', widget=DataGridWidget( label=_("Other Authors"), condition="here/condition_unregistered", description= _('If applicable, other authors or contributors of the paper or persons responsible for this piece, besides the principal author.' ), columns={ 'relationship': SelectColumn(_(u'Relation'), vocabulary="listRelatorTypes"), 'name': Column(_(u'Name')), 'institution': Column(_('Institution')), 'email': Column(_('email')), }, ), allow_empty_rows=False, required=False, columns=('relationship', 'name', 'institution', 'email')), # # Overrride default fields creators and contributors atapi.ComputedField(