예제 #1
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
예제 #2
0
    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()
예제 #3
0
 def meeting_templates_tab(self):
     if is_meeting_feature_enabled():
         return {
             'id': 'meetingtemplates',
             'title': _(u'label_meeting_templates', default=u'Meeting Templates'),
         }
     return None
예제 #4
0
 def proposals_tab(self):
     if is_meeting_feature_enabled():
         return {
             'id': 'proposals',
             'title': _(u'label_proposals', default=u'Proposals'),
             }
     return None
예제 #5
0
 def proposals_tab(self):
     if is_meeting_feature_enabled():
         return {
             'id': 'proposals',
             'title': _(u'label_proposals', default=u'Proposals'),
             }
     return None
예제 #6
0
    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
예제 #7
0
    def sablon_tab(self):
        if is_meeting_feature_enabled():
            return {
                'id': 'sablontemplates-proxy',
                'title': _(u'label_sablon_templates', default=u'Sablon Templates'),
                }

        return None
예제 #8
0
    def sablon_tab(self):
        if is_meeting_feature_enabled():
            return {
                'id': 'sablontemplates-proxy',
                'title': _(u'label_sablon_templates', default=u'Sablon Templates'),
                }

        return None
예제 #9
0
    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
예제 #10
0
    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
예제 #11
0
 def meeting_templates_tab(self):
     if is_meeting_feature_enabled():
         return {
             'id':
             'meetingtemplates',
             'title':
             _(u'label_meeting_templates', default=u'Meeting Templates'),
         }
     return None
예제 #12
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
예제 #13
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']:
            return is_meeting_feature_enabled()

        return True
예제 #14
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']:
            return is_meeting_feature_enabled()

        return True
예제 #15
0
    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
예제 #16
0
    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
예제 #17
0
    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)
예제 #18
0
    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)
예제 #19
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
예제 #20
0
    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()
예제 #22
0
 def __call__(self):
     return is_meeting_feature_enabled()
예제 #23
0
 def available(self):
     return is_meeting_feature_enabled() and \
         self.context.can_be_submitted_as_additional_document()
예제 #24
0
 def render(self):
     return is_meeting_feature_enabled()
예제 #25
0
    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
예제 #26
0
 def available(self):
     return is_meeting_feature_enabled() and \
         self.context.is_submit_additional_documents_allowed()
예제 #27
0
 def show_proposals_tab(self):
     return is_meeting_feature_enabled()
예제 #28
0
 def available(self):
     return is_meeting_feature_enabled()
예제 #29
0
 def show_proposals_tab(self):
     return is_meeting_feature_enabled()
예제 #30
0
 def available(self):
     return is_meeting_feature_enabled()
예제 #31
0
 def available(self):
     return is_meeting_feature_enabled() and \
         self.context.is_submit_additional_documents_allowed()
예제 #32
0
 def available(self):
     return is_meeting_feature_enabled() and \
         self.context.can_be_submitted_as_additional_document()