Exemplo n.º 1
0
    def handle_cancel_action(self, action, data):
        """
        """
        utils = getToolByName(self.context, "plone_utils")
        utils.addPortalMessage(_(u"Edit canceled"), "info")

        zope.event.notify(EditCancelledEvent(self.context))
        self._nextUrl()
Exemplo n.º 2
0
    def handle_save_action(self, action, data):
        """
        """
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            notify(ObjectModifiedEvent(self.context))
            notify(EditSavedEvent(self.context))
            self.status = "Changes saved"
        else:
            notify(EditCancelledEvent(self.context))
            self.status = "No changes"

        shop = IShopManagement(self.context).getShop()
        ICheckoutManagement(shop).redirectToNextURL("EDITED_ADDRESS")
Exemplo n.º 3
0
    def handle_save_action(self, action, data):
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            zope.event.notify(
                zope.lifecycleevent.ObjectModifiedEvent(self.context))
            zope.event.notify(EditSavedEvent(self.context))
            self.status = "Changes saved"
        else:
            zope.event.notify(EditCancelledEvent(self.context))
            self.status = "No changes"

        url = getMultiAdapter((self.context, self.request),
                              name='absolute_url')()
        self.request.response.redirect(url)
Exemplo n.º 4
0
    def handle_save_action(self, action, data):
        """
        """
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            notify(ObjectModifiedEvent(self.context))
            notify(EditSavedEvent(self.context))
            self.status = "Changes saved"
        else:
            notify(EditCancelledEvent(self.context))
            self.status = "No changes"

        self.context.reindexObject()
        self.nextUrl()
Exemplo n.º 5
0
    def handle_save_action(self, action, data):
        """
        """
        utils = getToolByName(self.context, "plone_utils")
        utils.addPortalMessage(_(u"Changes saved"), "info")
        if form.applyChanges(self.context, self.form_fields, data,
                             self.adapters):
            zope.event.notify(
                zope.lifecycleevent.ObjectModifiedEvent(self.context))
            zope.event.notify(EditSavedEvent(self.context))
        else:
            zope.event.notify(EditCancelledEvent(self.context))

        self.context.reindexObject()
        self._nextUrl()
Exemplo n.º 6
0
 def handle_cancel_action(self, action, data):
     zope.event.notify(EditCancelledEvent(self.context))
     url = getMultiAdapter((self.context, self.request),
                           name='absolute_url')()
     self.request.response.redirect(url)
Exemplo n.º 7
0
 def handle_cancel_action(self, action, data):
     """
     """
     notify(EditCancelledEvent(self.context))
     self.nextUrl()
Exemplo n.º 8
0
 def handle_cancel_action(self, action, data):
     """
     """
     notify(EditCancelledEvent(self.context))
     self.redirectToNextURL()