Пример #1
0
    def render(self):
        if is_oneoffixx_feature_enabled():
            payload = {'action': 'oneoffixx'}

            return self.create_officeconnector_url_json(payload)

        # Fail per default
        raise NotFound
Пример #2
0
    def oneoffixxtemplate_tab(self):
        if is_oneoffixx_feature_enabled():
            return {
                'id': 'oneoffixxtemplates',
                'title': _(u'label_oneoffixx_templates', default=u'OneOffixx'),
            }

        return None
Пример #3
0
    def render(self):
        if is_oneoffixx_feature_enabled():
            payload = {'action': 'oneoffixx'}

            return self.create_officeconnector_url_json(payload)

        # Fail per default
        raise NotFound
Пример #4
0
    def oneoffixxtemplate_tab(self):
        if is_oneoffixx_feature_enabled():
            return {
                'id': 'oneoffixxtemplates',
                'title': _(u'label_oneoffixx_templates', default=u'OneOffixx'),
            }

        return None
Пример #5
0
 def setup_external_edit_redirect(self, request, action='checkout'):
     redirector = IRedirector(request)
     if action == "checkout":
         if is_officeconnector_checkout_feature_enabled():
             redirector.redirect(create_oc_url(
                 request,
                 self,
                 dict(action=action),
             ))
         else:
             redirector.redirect(
                 '%s/external_edit' % self.absolute_url(),
                 target='_self',
                 timeout=1000)
     elif action == "oneoffixx" and is_oneoffixx_feature_enabled():
         redirector.redirect(create_oc_url(
                 request,
                 self,
                 dict(action=action),
             ))
Пример #6
0
 def setup_external_edit_redirect(self, request, action='checkout'):
     redirector = IRedirector(request)
     if action == "checkout":
         if is_officeconnector_checkout_feature_enabled():
             redirector.redirect(
                 create_oc_url(
                     request,
                     self,
                     dict(action=action),
                 ))
         else:
             redirector.redirect('%s/external_edit' % self.absolute_url(),
                                 target='_self',
                                 timeout=1000)
     elif action == "oneoffixx" and is_oneoffixx_feature_enabled():
         redirector.redirect(
             create_oc_url(
                 request,
                 self,
                 dict(action=action),
             ))
Пример #7
0
 def is_oneoffixx_creatable(self):
     return (is_oneoffixx_feature_enabled() and self.is_shadow_document()
             and not IDocumentSavedAsPDFMarker.providedBy(self))
 def __call__(self):
     return is_oneoffixx_feature_enabled()
Пример #9
0
 def test_true_if_registry_entry_is_true(self):
     self.activate_feature("officeconnector-checkout")
     self.activate_feature("oneoffixx")
     self.assertTrue(is_oneoffixx_feature_enabled())
Пример #10
0
 def test_false_if_officeconnector_checkout_is_disabled(self):
     self.activate_feature("oneoffixx")
     self.assertFalse(is_oneoffixx_feature_enabled())
Пример #11
0
 def test_true_if_registry_entry_is_true(self):
     self.activate_feature("officeconnector-checkout")
     self.activate_feature("oneoffixx")
     self.assertTrue(is_oneoffixx_feature_enabled())
Пример #12
0
 def test_false_if_officeconnector_checkout_is_disabled(self):
     self.deactivate_feature("officeconnector-checkout")
     self.activate_feature("oneoffixx")
     self.assertFalse(is_oneoffixx_feature_enabled())
 def __call__(self):
     return is_oneoffixx_feature_enabled()
Пример #14
0
 def is_oneoffixx_creatable(self):
     return (is_oneoffixx_feature_enabled()
             and self.is_shadow_document()
             and not IDocumentSavedAsPDFMarker.providedBy(self))