def filter_type(fti): factory_type = fti.id if factory_type in [u'opengever.meeting.sablontemplate']: return is_meeting_feature_enabled() if factory_type in [u'opengever.meeting.proposaltemplate']: return is_meeting_feature_enabled() if factory_type in [u'opengever.dossier.dossiertemplate']: return is_dossier_template_feature_enabled() return True
def render(self): assert self.fields, 'must specify model fields to render!' assert self.content_type, 'must configure content type!' if not is_meeting_feature_enabled(): raise Unauthorized return super(ModelProxyAddForm, self).render()
def meeting_templates_tab(self): if is_meeting_feature_enabled(): return { 'id': 'meetingtemplates', 'title': _(u'label_meeting_templates', default=u'Meeting Templates'), } return None
def proposals_tab(self): if is_meeting_feature_enabled(): return { 'id': 'proposals', 'title': _(u'label_proposals', default=u'Proposals'), } return None
def proposal_templates_tab(self): if is_meeting_feature_enabled(): return { 'id': 'proposaltemplates-proxy', 'title': _(u'label_proposal_templates', default=u'Proposal Templates'), } return None
def sablon_tab(self): if is_meeting_feature_enabled(): return { 'id': 'sablontemplates-proxy', 'title': _(u'label_sablon_templates', default=u'Sablon Templates'), } return None
def meeting_tabs(self): tabs = [] if is_meeting_feature_enabled(): tabs.append( {'id': 'myproposals', 'title': _('label_my_proposals', default=u'My proposals'), 'icon': None, 'url': '#', 'class': None}) return tabs
def filter_type(fti): factory_type = fti.id if factory_type in [u'opengever.meeting.sablontemplate', u'opengever.meeting.proposaltemplate', u'opengever.meeting.meetingtemplate']: return is_meeting_feature_enabled() if factory_type in [u'opengever.dossier.dossiertemplate']: return is_dossier_template_feature_enabled() return True
def addable(self, depth): container_type = self.context.portal_type factory_type = self.fti.id mapping = self.constrain_type_mapping for const_ctype, const_depth, const_ftype in mapping: if const_ctype == container_type and const_ftype == factory_type: return depth < const_depth or const_depth == 0 if factory_type in [u'opengever.meeting.proposal']: return is_meeting_feature_enabled() return True
def get_metadata_config(self): rows = [ FieldRow('title'), FieldRow('IDocumentMetadata.document_date'), TemplateRow(self.file_template, label=_('label_file', default='File')), CustomRow(self.get_creation_date, label=_('label_created', default='Created')), CustomRow(self.get_modification_date, label=_('label_modified', default='Modified')), FieldRow('IDocumentMetadata.document_type'), FieldRow('IDocumentMetadata.document_author'), CustomRow(self.render_creator_link, label=_('label_creator', default='creator')), WebIntelligentFieldRow('IDocumentMetadata.description'), TemplateRow(self.keywords_template, label=_(u'label_keywords', default=u'Keywords')), FieldRow('IDocumentMetadata.foreign_reference'), CustomRow(self.render_checked_out_link, label=_('label_checked_out', default='Checked out')), FieldRow('IDocumentMetadata.digitally_available'), FieldRow('IDocumentMetadata.preserved_as_paper'), FieldRow('IDocumentMetadata.receipt_date'), FieldRow('IDocumentMetadata.delivery_date'), TemplateRow(self.related_documents_template, label=_(u'label_related_documents', default=u'Related Documents')), FieldRow('IClassification.classification'), FieldRow('IClassification.privacy_layer'), TemplateRow(self.public_trial_template, label=ogbmf('label_public_trial', default='Public Trial')), FieldRow('IClassification.public_trial_statement') ] if self.is_archivale_file_visible(): row = TemplateRow(self.archival_file_template, label=_(u'label_archival_file', default='Archival File')) rows.append(row) row = CustomRow(self.render_archival_file_state, label=_('label_archival_file_state', default='Archival file state')) rows.append(row) if is_meeting_feature_enabled(): rows.append( TemplateRow(self.submitted_with_template, label=_('Submitted with'))) return rows
def get_metadata_config(self): rows = [ FieldRow('title'), FieldRow('IDocumentMetadata.document_date'), TemplateRow(self.file_template, label=_('label_file', default='File')), CustomRow(self.get_creation_date, label=_('label_created', default='Created')), CustomRow(self.get_modification_date, label=_('label_modified', default='Modified')), FieldRow('IDocumentMetadata.document_type'), FieldRow('IDocumentMetadata.document_author'), CustomRow(self.render_creator_link, label=_('label_creator', default='creator')), WebIntelligentFieldRow('IDocumentMetadata.description'), TemplateRow(self.keywords_template, label=_(u'label_keywords', default=u'Keywords')), FieldRow('IDocumentMetadata.foreign_reference'), CustomRow(self.render_checked_out_link, label=_('label_checked_out', default='Checked out')), FieldRow('IDocumentMetadata.digitally_available'), FieldRow('IDocumentMetadata.preserved_as_paper'), FieldRow('IDocumentMetadata.receipt_date'), FieldRow('IDocumentMetadata.delivery_date'), TemplateRow(self.related_documents_template, label=_( u'label_related_documents', default=u'Related Documents')), FieldRow('IClassification.classification'), FieldRow('IClassification.privacy_layer'), TemplateRow(self.public_trial_template, label=ogbmf('label_public_trial', default='Public Trial')), FieldRow('IClassification.public_trial_statement') ] if self.is_archivale_file_visible(): row = TemplateRow( self.archival_file_template, label=_(u'label_archival_file', default='Archival File')) rows.append(row) row = CustomRow(self.render_archival_file_state, label=_('label_archival_file_state', default='Archival file state')) rows.append(row) if is_meeting_feature_enabled(): rows.append(TemplateRow(self.submitted_with_template, label=_('Submitted with'))) return rows
def bodyClass(self, template, view): """Extends the default body class with the `feature-bumblebee` class, if the bumblebeefeature is enabled. """ classes = [super(GeverLayoutPolicy, self).bodyClass(template, view)] if is_bumblebee_feature_enabled(): classes.append('feature-bumblebee') if is_meeting_feature_enabled(): classes.append('feature-word-meeting') if ISQLObjectWrapper.providedBy(self.context): normalize = getUtility(IIDNormalizer).normalize classes.append('model-{}'.format( normalize(type(self.context.model).__name__))) return ' '.join(classes)
def addable(self, depth): container_type = self.context.portal_type factory_type = self.fti.id mapping = self.constrain_type_mapping for const_ctype, const_depth, const_ftype in mapping: if const_ctype == container_type and const_ftype == factory_type: return depth < const_depth or const_depth == 0 if factory_type in [ u'opengever.meeting.proposal', u'opengever.meeting.sablontemplate' ]: return is_meeting_feature_enabled() if factory_type in [u'opengever.meeting.proposaltemplate']: return is_word_meeting_implementation_enabled() if factory_type in [u'opengever.dossier.dossiertemplate']: return is_dossier_template_feature_enabled() return True
def is_filtered(self, factory): factory_id = factory.get('id') if factory_id == u'opengever.meeting.committeecontainer': return not is_meeting_feature_enabled() return False
def __call__(self): return is_meeting_feature_enabled()
def available(self): return is_meeting_feature_enabled() and \ self.context.can_be_submitted_as_additional_document()
def render(self): return is_meeting_feature_enabled()
def available(self): return is_meeting_feature_enabled() and \ self.context.is_submit_additional_documents_allowed()
def show_proposals_tab(self): return is_meeting_feature_enabled()
def available(self): return is_meeting_feature_enabled()