Commit b8ac94ea authored by Jean-Paul Smets's avatar Jean-Paul Smets

Use ourselves for both to and from if no value provided to send


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5225 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 98c66db0
...@@ -55,49 +55,6 @@ class Url(Coordinate, Base): ...@@ -55,49 +55,6 @@ class Url(Coordinate, Base):
, PropertySheet.Url , PropertySheet.Url
) )
# Factory Type Information
factory_type_information = \
{ 'id' : portal_type
, 'meta_type' : meta_type
, 'description' : """\
A Url is allows to represent in a standard way coordinates
such as web sites, emails, ftp sites, etc."""
, 'icon' : 'url_icon.gif'
, 'product' : 'ERP5'
, 'factory' : 'addUrl'
, 'immediate_view' : 'url_edit'
, 'actions' :
( { 'id' : 'view'
, 'name' : 'View'
, 'category' : 'object_view'
, 'action' : 'url_edit'
, 'permissions' : (
Permissions.View, )
}
, { 'id' : 'print'
, 'name' : 'Print'
, 'category' : 'object_print'
, 'action' : 'url_print'
, 'permissions' : (
Permissions.View, )
}
, { 'id' : 'metadata'
, 'name' : 'Metadata'
, 'category' : 'object_view'
, 'action' : 'metadata_edit'
, 'permissions' : (
Permissions.View, )
}
, { 'id' : 'translate'
, 'name' : 'Translate'
, 'category' : 'object_action'
, 'action' : 'translation_template_view'
, 'permissions' : (
Permissions.TranslateContent, )
}
)
}
security.declareProtected(Permissions.View, 'asText') security.declareProtected(Permissions.View, 'asText')
def asText(self): def asText(self):
return self.url_string return self.url_string
...@@ -120,9 +77,11 @@ such as web sites, emails, ftp sites, etc.""" ...@@ -120,9 +77,11 @@ such as web sites, emails, ftp sites, etc."""
Send An Email Send An Email
""" """
# We assume by default that we are replying to the sender # If no URL is specified, use ourselves
if from_url == None: if from_url == None:
from_url = self.getUrlString() from_url = self.getUrlString()
if to_url == None:
to_url = self.getUrlString()
if to_url.find('@')>=0: # We will send an email if to_url.find('@')>=0: # We will send an email
if msg is not None and subject is not None: if msg is not None and subject is not None:
header = "From: %s\n" % from_url header = "From: %s\n" % from_url
......
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