Commit 5f10bde2 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use BaseTool as a base class.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16720 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c2ed78f3
...@@ -26,11 +26,9 @@ ...@@ -26,11 +26,9 @@
# #
############################################################################## ##############################################################################
from Products.CMFCore.utils import UniqueObject
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Globals import InitializeClass, DTMLFile, PersistentMapping from Globals import InitializeClass, DTMLFile, PersistentMapping
from Products.ERP5Type.Core.Folder import Folder from Products.ERP5Type.Tool.BaseTool import BaseTool
from Products.ERP5Type import Permissions from Products.ERP5Type import Permissions
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
...@@ -38,10 +36,9 @@ from Products.ERP5 import _dtmldir ...@@ -38,10 +36,9 @@ from Products.ERP5 import _dtmldir
import threading import threading
from zLOG import LOG
from BTrees.Length import Length from BTrees.Length import Length
class IdTool(UniqueObject, Folder): class IdTool(BaseTool):
""" """
This tools handles the generation of IDs. This tools handles the generation of IDs.
...@@ -54,24 +51,9 @@ class IdTool(UniqueObject, Folder): ...@@ -54,24 +51,9 @@ class IdTool(UniqueObject, Folder):
# Declarative Security # Declarative Security
security = ClassSecurityInfo() security = ClassSecurityInfo()
#
# ZMI methods
#
manage_options = ( ( { 'label' : 'Overview'
, 'action' : 'manage_overview'
}
,
)
+ Folder.manage_options
)
security.declareProtected( Permissions.ManagePortal, 'manage_overview' ) security.declareProtected( Permissions.ManagePortal, 'manage_overview' )
manage_overview = DTMLFile( 'explainIdTool', _dtmldir ) manage_overview = DTMLFile( 'explainIdTool', _dtmldir )
# Filter content (ZMI))
def __init__(self):
return Folder.__init__(self, IdTool.id)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getLastGeneratedId') 'getLastGeneratedId')
def getLastGeneratedId(self,id_group=None,default=None): def getLastGeneratedId(self,id_group=None,default=None):
......
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