def __call__(self): if is_contact_feature_enabled(): return self.request.RESPONSE.redirect( self.get_url('add-sql-participation')) return self.request.response.redirect( self.get_url('add-plone-participation'))
def get_tabs(self): if is_contact_feature_enabled(): tabs = [ {'id': 'persons', 'title': _(u'label_persons', default=u'Persons'), 'icon': None, 'url': '#', 'class': None}, {'id': 'organizations', 'title': _(u'label_organizations', default=u'Organizations'), 'icon': None, 'url': '#', 'class': None}] else: tabs = [ {'id': 'local', 'title': _(u'label_local', default=u'Local'), 'icon': None, 'url': '#', 'class': None}, ] tabs += [ {'id': 'users', 'title': _(u'label_users', default=u'Users'), 'icon': None, 'url': '#', 'class': None}] return tabs
def participations_tab(self): if is_contact_feature_enabled(): return { 'id': 'participations', 'title': _(u'label_participations', default=u'Participations'), } return { 'id': 'participants', 'title': _(u'label_participants', default=u'Participants'), }
def make_participation_box(self): if is_contact_feature_enabled(): return dict(id='participations', content=self.sql_participations(), href='participations', label=_("Participations"), available=self.context.has_participation_support()) else: return dict(id='participants', content=self.plone_participations(), href='participants', label=_("Participants"), available=self.context.has_participation_support())
def updateWidgets(self, prefix=None): super(ManualJournalEntryAddForm, self).updateWidgets(prefix=prefix) if not is_contact_feature_enabled(): self.widgets['contacts'].mode = HIDDEN_MODE
def updateFieldsFromSchemata(self): super(SelectTemplateDocumentWizardStep, self).updateFieldsFromSchemata() if not is_contact_feature_enabled(): self.fields = self.fields.omit('recipient')
def steps(self): if not is_contact_feature_enabled(): return [] return [('select-document', _(u'Select document')), ('select-address', _(u'Select recipient address'))]
def filter_type(fti): if fti.id == "opengever.contact.contact": return not is_contact_feature_enabled() return True