Esempio n. 1
0
 def is_available(self):
     """Checks if it is allowed to add a 'dossier from template'
     at the current context.
     """
     return is_dossier_template_feature_enabled() and \
         self.context.is_leaf_node() and \
         api.user.has_permission('opengever.dossier: Add businesscasedossier', obj=self.context)
Esempio n. 2
0
 def is_available(self):
     """Checks if it is allowed to add a 'dossier from template'
     at the current context.
     """
     return is_dossier_template_feature_enabled() and \
         self.context.is_leaf_node() and \
         api.user.has_permission('opengever.dossier: Add businesscasedossier', obj=self.context)
Esempio n. 3
0
    def dossiertemplate_tab(self):
        if is_dossier_template_feature_enabled():
            return {
                'id': 'dossiertemplates',
                'title': _(u'label_dossier_templates', default=u'Dossier templates'),
                }

        return None
Esempio n. 4
0
    def dossiertemplate_tab(self):
        if is_dossier_template_feature_enabled():
            return {
                'id': 'dossiertemplates',
                'title': _(u'label_dossier_templates', default=u'Dossier templates'),
                }

        return None
Esempio n. 5
0
        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
Esempio n. 6
0
        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
Esempio n. 7
0
    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.dossier.dossiertemplate']:
            return is_dossier_template_feature_enabled()

        return True
Esempio n. 8
0
    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
Esempio n. 9
0
    def test_false_if_registry_entry_is_false(self):
        api.portal.set_registry_record('is_feature_enabled',
                                       False,
                                       interface=IDossierTemplateSettings)

        self.assertFalse(is_dossier_template_feature_enabled())
    def test_false_if_registry_entry_is_false(self):
        api.portal.set_registry_record(
            'is_feature_enabled', False, interface=IDossierTemplateSettings)

        self.assertFalse(is_dossier_template_feature_enabled())