Commit e51cf7f0 authored by Jérome Perrin's avatar Jérome Perrin

XXX restore a constructUrlFor NOTFORMERGE

I need this to be able to update an instance
parent 58144924
......@@ -232,6 +232,7 @@ class ERP5Site(FolderMixIn, CMFSite, CacheCookieMixin):
The *only* function this class should have is to help in the setup
of a new ERP5. It should not assist in the functionality at all.
"""
constructUrlFor = CMFSite.absolute_url
meta_type = 'ERP5 Site'
portal_type = 'ERP5 Site'
constructors = (('addERP5Site', manage_addERP5SiteForm), manage_addERP5Site, )
......
......@@ -733,6 +733,12 @@ class Base( CopyContainer,
could work as a workflow but CPU expensive
"""
def constructUrlFor(self, form_id='', dialog_id='', parameter_dict=None, *args, **kw):
from ZTUtils import make_query
url = '%s/%s' % (self.absolute_url(), form_id or dialog_id)
if parameter_dict:
url = '%s?%s' % (url, make_query(parameter_dict))
return url
meta_type = 'ERP5 Base Object'
portal_type = 'Base Object'
#_local_properties = () # no need since getattr
......
......@@ -158,6 +158,13 @@ class FolderMixIn(ExtensionClass.Base):
# flag to hold the status of migration for this folder
_migration_in_progress = False
def constructUrlFor(self, form_id='', dialog_id='', parameter_dict=None, *args, **kw):
from ZTUtils import make_query
url = '%s/%s' % (self.absolute_url(), form_id or dialog_id)
if parameter_dict:
url = '%s?%s' % (url, make_query(parameter_dict))
return url
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment