class InvoiceBatchSchemaExtender(object): adapts(IInvoiceBatch) implements(IOrderableSchemaExtender) fields = [ ExtReferenceField( 'Project', allowed_types=('Project', ), required=True, relationship='InvoiceProject', referenceClass=HoldingReference, widget=bika_ReferenceWidget( label=_("Project"), catalog_name='bika_catalog', size=30, showOn=True, description=_("Click and select project for the kit."), )), ExtStringField('Service', searchable=True, vocabulary=INVOICE_SERVICES, widget=SelectionWidget( format="select", label=_("Service"), description=_("Select the service to invoice."), )), ExtLinesField( 'Services', vocabulary=INVOICE_SERVICES, widget=MultiSelectionWidget( label=_("Invoice Services"), description=_("Select the services to invoice."), ), ), ] def __init__(self, context): self.context = context def getFields(self): return self.fields def getOrder(self, schematas): sch = schematas['default'] sch.remove('Project') sch.remove('Services') sch.insert(sch.index('BatchStartDate'), 'Project') sch.insert(sch.index('BatchStartDate'), 'Services') schematas['default'] = sch return schematas
def update_config_schema(baseSchema): specificSchema = Schema(( IntegerField( name='lastMeetingNumberInParliamentaryTerm', default=0, widget=IntegerField._properties['widget']( description="LastMeetingNumberInParliamentaryTerm", description_msgid= "last_meeting_number_in_parliamentary_term_descr", label='Lastmeetingnumberinparliamentaryterm', label_msgid= 'MeetingAndenne_label_lastMeetingNumberInParliamentaryTerm', i18n_domain='PloneMeeting', ), write_permission=WriteRiskyConfig, ), BooleanField( name='useSubCategories', default=False, widget=BooleanField._properties['widget']( description="UseSubCategories", description_msgid="use_sub_categories_descr", label='Usesubcategories', label_msgid='MeetingAndenne_label_useSubCategories', i18n_domain='PloneMeeting'), write_permission=WriteRiskyConfig, ), LinesField( name='selectableAssociatedGroups', widget=MultiSelectionWidget( size=20, description="SelectableAssociatedGroups", description_msgid="selectable_associated_groups_descr", label='Selectableassociatedgroups', label_msgid='MeetingAndenne_label_selectableAssociatedGroups', i18n_domain='PloneMeeting', ), schemata="advices", multiValued=1, vocabulary='listSelectableAssociatedGroups', enforceVocabulary=True, write_permission=WriteRiskyConfig, ), ), ) completeConfigSchema = baseSchema + specificSchema.copy() return completeConfigSchema
relationship='SetupDryAnalysisService', vocabulary='getAnalysisServices', referenceClass=HoldingReference, widget=ReferenceWidget( label=_("Dry matter analysis"), description=_("The analysis to be used for determining dry matter."), ) ), LinesField( 'ARImportOption', schemata="Analyses", vocabulary=ARIMPORT_OPTIONS, widget=MultiSelectionWidget( visible=False, label=_("AR Import options"), description=_( "'Classic' indicates importing analysis requests per sample and " "analysis service selection. With 'Profiles', analysis profile keywords " "are used to select multiple analysis services together"), ) ), StringField( 'ARAttachmentOption', schemata="Analyses", default='p', vocabulary=ATTACHMENT_OPTIONS, widget=SelectionWidget( format='select', label=_("AR Attachment Option"), description=_( "The system wide default configuration to indicate " "whether file attachments are required, permitted or not "
checkbox_bound=0, label=_("Data Interface"), description=_("Select an Export interface for this instrument."), format='select', default='', visible=True, ), ), StringField( 'ImportDataInterface', vocabulary="getImportDataInterfacesList", multiValued=1, widget=MultiSelectionWidget( checkbox_bound=0, label=_("Import Data Interface"), description=_("Select an Import interface for this instrument."), format='select', default='', visible=True, ), ), RecordsField( 'ResultFilesFolder', subfields=('InterfaceName', 'Folder'), subfield_labels={ 'InterfaceName': _('Interface Code'), 'Folder': _('Folder that results will be saved') }, subfield_readonly={ 'InterfaceName': True, 'Folder': False },
def update_item_schema(baseSchema): specificSchema = Schema(( StringField( name='refdoc', default_method="getDocReference", widget=StringWidget( size=100, label='Refdoc', label_msgid='MeetingAndenne_label_refDoc', i18n_domain='PloneMeeting', ), searchable=True, ), StringField( name='verifUser', default_method="Creator", widget=StringWidget( visible=False, format="select", label='Verifuser', label_msgid='MeetingAndenne_label_verifUser', i18n_domain='PloneMeeting', ), searchable=True, ), StringField(name='yourrefdoc', widget=StringWidget( size=100, label='yourRefdoc', label_msgid='MeetingAndenne_label_yourrefDoc', i18n_domain='PloneMeeting', ), searchable=True), StringField( name='treatUser', default_method="Creator", widget=SelectionWidget( format="select", label='Treatuser', label_msgid='MeetingAndenne_label_treatUser', i18n_domain='PloneMeeting', ), vocabulary='listTreatUsers', searchable=True, ), TextField(name='projetpv', widget=RichWidget( rows=15, label='Projetpv', label_msgid='MeetingAndenne_label_projetpv', i18n_domain='PloneMeeting', ), read_permission="PloneMeeting: Read decision", default_content_type="text/html", searchable=True, write_permission="PloneMeeting: Write decision", allowable_content_types=('text/html', ), default_output_type="text/html"), TextField(name='pv', widget=RichWidget( rows=15, label='Pv', label_msgid='MeetingAndenne_label_pv', i18n_domain='PloneMeeting', ), read_permission="MeetingAndenne: Read pv", default_content_type="text/html", searchable=True, write_permission="MeetingAndenne: Write pv", allowable_content_types=('text/html', ), default_output_type="text/html"), TextField(name='textpv', widget=RichWidget( rows=15, label='Textpv', label_msgid='MeetingAndenne_label_textpv', i18n_domain='PloneMeeting', ), read_permission="MeetingAndenne: Read pv", default_content_type="text/html", searchable=True, write_permission="MeetingAndenne: Write pv", allowable_content_types=('text/html', ), default_output_type="text/html"), BooleanField(name='isconfidential', widget=BooleanWidget( label='IsConfidential', label_msgid='MeetingAndenne_label_isConfidential', i18n_domain='PloneMeeting', ), searchable=True, default=False), LinesField( name='itemPresents', widget=MultiSelectionWidget( visible=False, format="checkbox", label='Itempresents', label_msgid='MeetingAndenne_label_itemPresents', i18n_domain='PloneMeeting', ), multiValued=1, ), ), ) completeItemSchema = baseSchema + specificSchema.copy() completeItemSchema[ 'title'].widget.condition = "python: not hasattr(here, 'template') or not here.queryState()=='itemcreated' or here.portal_membership.getAuthenticatedMember().has_role('Manager')" completeItemSchema[ 'copyGroups'].write_permission = "MeetingAndenne: Write copygroup" completeItemSchema[ 'description'].widget.label_method = 'getLabelForDescription' completeItemSchema['budgetInfos'].widget.rows = 12 completeItemSchema['itemSignatories'].optional = True completeItemSchema[ 'proposingGroup'].default_method = "getDefaultProposingGroup" completeItemSchema[ 'notes'].read_permission = "PloneMeeting: Read item observations" completeItemSchema[ 'notes'].write_permission = "PloneMeeting: Write item observations" completeItemSchema['votesAreSecret'].default = True completeItemSchema['category'].widget = DynatreeWidget( condition="python: here.showCategory()", description="Category", description_msgid="item_category_descr", label='Category', label_msgid='PloneMeeting_label_category', i18n_domain='PloneMeeting', leafsOnly=True, rootVisible=True, selectMode=1, sparse=False, ) completeItemSchema['category'].vocabulary = SubCategoriesVocabulary() completeItemSchema.moveField('refdoc', pos='top') completeItemSchema.moveField('yourrefdoc', pos=2) completeItemSchema.moveField('treatUser', pos=8) completeItemSchema.moveField('projetpv', pos=25) completeItemSchema.moveField('pv', pos=25) completeItemSchema.moveField('textpv', pos=24) completeItemSchema.moveField('isconfidential', pos='top') return completeItemSchema
i18n_domain="eea", visible={'edit': 'visible', 'view': 'invisible'} ) ), LinesField( name='classificationTopicCategory', languageIndependent=True, required=False, multiValued=1, default=[], vocabulary=TOPIC_CATEGORY_VOCAB, schemata='metadata', widget=MultiSelectionWidget( size=17, label="Topic of category", description=("Main theme(s) of the dataset"), label_msgid='topic_of_category', description_msgid='description_topic_of_category', i18n_domain='eea', ) ), StringField( name='sectionTitleGeographic', # ===================================== schemata='metadata', widget=LabelWidget( label=('GEOGRAPHIC REFERENCE'), i18n_domain="eea", visible={'edit': 'visible', 'view': 'invisible'} ) ), GeographicBoundingBoxField( name='geographicBoundingBox',
dataservice_base_schema = Schema(( LinesField( name='geographicCoverage', languageIndependent=True, required=True, multiValued=1, default=[], vocabulary=NamedVocabulary(COUNTRIES_DICTIONARY_ID), widget=MultiSelectionWidget( macro="countries_widget", helper_js=("countries_widget.js",), helper_css=("countries_widget.css",), size=15, label="Geographic coverage", description=("Type in here the exact geographic names/places " "that are covered by the data. Add Countries names only if " "the data displayed is really about the entire country. " "Example of locations/places are lakes, rivers, cities, " "marine areas, glaciers, bioregions like alpine region etc."), label_msgid='dataservice_label_geographic', description_msgid='dataservice_help_geographic', i18n_domain='eea', ) ), ManagementPlanField( name='eeaManagementPlan', languageIndependent=True, required=True, default=(datetime.now().year, ''), validators=('management_plan_code_validator',),
), LinesField( 'locallyAllowedTypes', vocabulary='_ct_vocabularyPossibleTypes', enforceVocabulary=False, languageIndependent=True, default_method='_ct_defaultAddableTypeIds', accessor='getLocallyAllowedTypes', # Respects ENABLE/DISABLE/ACQUIRE write_permission=ATCTPermissions.ModifyConstrainTypes, multiValued=True, widget=MultiSelectionWidget( size=10, label=_(u'label_constrain_allowed_types', default=u'Permitted types'), description=_(u'description_constrain_allowed_types', default=u'Select the types which will be addable ' u'inside this folder.'), visible={ 'view': 'invisible', 'edit': 'invisible' }, ), ), LinesField( 'immediatelyAddableTypes', vocabulary='_ct_vocabularyPossibleTypes', enforceVocabulary=False, languageIndependent=True, default_method='_ct_defaultAddableTypeIds', # Respects ENABLE/DISABLE/ACQUIRE: accessor='getImmediatelyAddableTypes', write_permission=ATCTPermissions.ModifyConstrainTypes,
'Instructions/directions that all assignment boxes in this folder refer to', description_msgid='help_directions', i18n_domain=config.I18N_DOMAIN, allow_file_upload=False, rows=8, ), ), LinesField( 'completedStates', searchable=False, vocabulary='getCompletedStatesVocab', multiValued=True, widget=MultiSelectionWidget( label="Completed States", label_msgid="label_completed_states", description="States considered as completed", description_msgid="help_completed_states", i18n_domain=config.I18N_DOMAIN, ), ), IntegerField( 'projectedAssignments', searchable=False, required=True, default=0, validators=('isInt', validators.POSITIVE_NUMBER_VALIDATOR_NAME), widget=IntegerWidget( label="Projected Number of Assignments", label_msgid="label_projected_assignments", description="Projected number of assignments, 0 means undefined", description_msgid="help_projected_assignments",
description="MeetingUserReplacementDuty", description_msgid="meeting_user_replacement_duty_descr", condition="python: here.isManager()", label='Replacementduty', label_msgid='PloneMeeting_label_replacementDuty', i18n_domain='PloneMeeting', ), write_permission="PloneMeeting: Write risky config", ), LinesField( name='usages', widget=MultiSelectionWidget( description="MeetingUserUsages", description_msgid="meeting_user_usages_descr", format="checkbox", condition="python: here.isManager()", label='Usages', label_msgid='PloneMeeting_label_usages', i18n_domain='PloneMeeting', ), enforceVocabulary=True, multiValued=1, vocabulary='listUsages', write_permission="PloneMeeting: Write risky config", ), ImageField( name='signatureImage', widget=ImageField._properties['widget']( description="MeetingUserSignatureImage", description_msgid="meeting_user_signature_image_descr", condition="python: here.isManager()",
def update_item_schema(baseSchema): specificSchema = Schema( ( StringField( name='grpBudgetInfos', widget=MultiSelectionWidget( description="GrpBudgetInfos", description_msgid="MeetingNamur_descr_grpBudgetInfos", size=10, label='GrpBudgetInfos', label_msgid='MeetingNamur_label_grpBudgetInfos', i18n_domain='PloneMeeting', ), vocabulary='listGrpBudgetInfosAdviser', multiValued=1, enforceVocabulary=False, ), # field used to define specific certified signatures for a MeetingItem TextField( name='itemCertifiedSignatures', widget=TextAreaWidget( label='Signatures', label_msgid='PloneMeeting_label_certifiedSignatures', description= 'Leave empty to use the certified signatures defined on the meeting or MeetingGroup', description_msgid='MeetingNamur_descr_certified_signatures', i18n_domain='PloneMeeting', ), write_permission='MeetingNamur: Write certified signatures', allowable_content_types=('text/plain', ), default_output_type='text/plain', default_content_type='text/plain', ), # field use to specify if this item is privacy (in this case, it's not visible in public pv) BooleanField( name='isConfidentialItem', default=False, widget=BooleanField._properties['widget']( condition= "python: here.portal_plonemeeting.isManager(here)", label='IsConfidentialItem', label_msgid='MeetingNamur_isConfidentialItem', i18n_domain='PloneMeeting', ), optional=True, ), TextField( name='vote', widget=RichWidget( condition="python: here.attributeIsUsed('vote')", description="Vote", description_msgid="item_vote_descr", label='Vote', label_msgid='MeetingNamur_vote', i18n_domain='PloneMeeting', ), optional=True, write_permission= "PloneMeeting: Write item MeetingManager reserved fields", default_content_type="text/html", allowable_content_types=('text/html', ), default_output_type="text/x-html-safe", ), ), ) baseSchema[ 'description'].write_permission = "MeetingNamur: Write description" baseSchema['description'].widget.label = "projectOfDecision" baseSchema['description'].widget.label_msgid = "projectOfDecision_label" completeSchema = baseSchema + specificSchema.copy() return completeSchema
StringField( name='acronym', widget=StringField._properties['widget']( label='Acronym', label_msgid='PloneMeeting_label_acronym', i18n_domain='PloneMeeting', ), required=True, write_permission="PloneMeeting: Write risky config", ), LinesField( name='itemAdviceStates', widget=MultiSelectionWidget( description="ItemAdviceStates", description_msgid="group_item_advice_states_descr", format="checkbox", label='Itemadvicestates', label_msgid='PloneMeeting_label_itemAdviceStates', i18n_domain='PloneMeeting', ), multiValued=1, vocabulary='listItemStates', write_permission="PloneMeeting: Write risky config", ), LinesField( name='itemAdviceEditStates', widget=MultiSelectionWidget( description="ItemAdviceEditStates", description_msgid="group_item_advice_edit_states_descr", format="checkbox", label='Itemadviceeditstates', label_msgid='PloneMeeting_label_itemAdviceEditStates',
('and', _(u'and')), ('or', _(u'or')), )) ATSelectionCriterionSchema = ATBaseCriterionSchema + Schema(( LinesField( 'value', required=1, mode="rw", write_permission=ChangeTopics, accessor="Value", mutator="setValue", default=[], vocabulary="getCurrentValues", widget=MultiSelectionWidget( label=_(u'label_criteria_values', default=u'Values'), description=_(u'help_criteria_values', default=u'Existing values.')), ), StringField( 'operator', required=1, mode="rw", write_permission=ChangeTopics, default='or', vocabulary=CompareOperators, widget=SelectionWidget( label=_(u'label_list_criteria_operator', default=u'operator name'), description=_( u'help_list_criteria_operator', default=u'Operator used to join the tests on each value.')), ),