Commit 41dc4d94 authored by Aurel's avatar Aurel

remove inherintance from XMLOBject as it is get by Folder one

add viewImage method to render image
add importSignature method


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5957 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c1958c26
...@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject ...@@ -34,7 +34,7 @@ from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Type.Document.Folder import Folder from Products.ERP5Type.Document.Folder import Folder
class Agent(Folder, Image, XMLObject): class Agent(Folder, Image):
""" """
An Agent is a Person who is permitted to perform some actions on the bank account according to Privileges. An Agent is a Person who is permitted to perform some actions on the bank account according to Privileges.
""" """
...@@ -56,3 +56,34 @@ class Agent(Folder, Image, XMLObject): ...@@ -56,3 +56,34 @@ class Agent(Folder, Image, XMLObject):
, PropertySheet.Task , PropertySheet.Task
, PropertySheet.Agent , PropertySheet.Agent
) )
def __init__(self, *args, **kw):
Folder.__init__(self, *args, **kw)
Image.__init__(self, *args, **kw)
security.declareProtected(Permissions.AccessContentsInformation, 'viewImage')
viewImage = Image.index_html
def importSignature(self, import_file=None, form_id=None, REQUEST=None, **kw):
if REQUEST is None:
REQUEST = getattr(self, 'REQUEST', None)
if (import_file is None) or (len(import_file.read()) == 0) :
if REQUEST is not None :
REQUEST.RESPONSE.redirect("%s?portal_status_message=No+file+or+an+empty+file+was+specified"
% self.absolute_url())
return
else :
raise RuntimeError, 'No file or an empty file was specified'
import_file.seek(0)
self.manage_editPhoto(file=import_file)
# self._data = import_file.read()
if REQUEST is not None:
ret_url = self.absolute_url() + '/' + REQUEST.get('form_id', 'view')
REQUEST.RESPONSE.redirect("%s?portal_status_message=Signature+Imported+Successfully"
% ret_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