Beispiel #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
Beispiel #2
0
    def oneoffixxtemplate_tab(self):
        if is_oneoffixx_feature_enabled():
            return {
                'id': 'oneoffixxtemplates',
                'title': _(u'label_oneoffixx_templates', default=u'OneOffixx'),
            }

        return None
Beispiel #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
Beispiel #4
0
    def oneoffixxtemplate_tab(self):
        if is_oneoffixx_feature_enabled():
            return {
                'id': 'oneoffixxtemplates',
                'title': _(u'label_oneoffixx_templates', default=u'OneOffixx'),
            }

        return None
Beispiel #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),
             ))
Beispiel #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),
             ))
Beispiel #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()
 def test_true_if_registry_entry_is_true(self):
     self.activate_feature("officeconnector-checkout")
     self.activate_feature("oneoffixx")
     self.assertTrue(is_oneoffixx_feature_enabled())
 def test_false_if_officeconnector_checkout_is_disabled(self):
     self.activate_feature("oneoffixx")
     self.assertFalse(is_oneoffixx_feature_enabled())
 def test_true_if_registry_entry_is_true(self):
     self.activate_feature("officeconnector-checkout")
     self.activate_feature("oneoffixx")
     self.assertTrue(is_oneoffixx_feature_enabled())
 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()
Beispiel #14
0
 def is_oneoffixx_creatable(self):
     return (is_oneoffixx_feature_enabled()
             and self.is_shadow_document()
             and not IDocumentSavedAsPDFMarker.providedBy(self))