diff --git a/__init__.py b/__init__.py index f2cac0e..9ebda76 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,10 @@ from Globals import package_home -from Products.CMFCore import utils, CMFCorePermissions, DirectoryView -from Products.CMFPlone.PloneUtilities import ToolInit +try: # New CMF + from Products.CMFCore import permissions as CMFCorePermissions +except: # Old CMF + from Products.CMFCore import CMFCorePermissions +from Products.CMFCore import utils, DirectoryView +from Products.CMFPlone.utils import ToolInit from Products.Archetypes.public import * from Products.Archetypes import listTypes from Products.Archetypes.utils import capitalize diff --git a/config.py b/config.py index c797881..d989a4a 100644 --- a/config.py +++ b/config.py @@ -1,4 +1,7 @@ -from Products.CMFCore.CMFCorePermissions import setDefaultRoles +try: # New CMF + from Products.CMFCore.permissions import setDefaultRoles +except: # Old CMF + from Products.CMFCore.CMFCorePermissions import setDefaultRoles PROJECTNAME = "CV" DEFAULT_ADD_CONTENT_PERMISSION = "Add CV" diff --git a/content/cv.py b/content/cv.py index b386f8b..fa7a773 100644 --- a/content/cv.py +++ b/content/cv.py @@ -315,7 +315,7 @@ default_view = 'cv_view' immediate_view = 'cv_view' # __implements__ = ATFolder.__implements__ + [INonStructuralFolder] - actions = ATFolder.actions +# actions = ATFolder.actions def canSetDefaultPage(self): return False @@ -329,6 +329,14 @@ self.getEmail(), self.getBirthDate()) + def lastModified(self): + """ Gets the date of the latest edit, including subobjects """ + lastMod = self.ModificationDate() + for subobject in self.objectValues(): + if subobject.ModificationDate() > lastMod: + lastMod = subobject.ModificationDate() + return lastMod + registerType(CV) class Education(ATCTContent): @@ -338,7 +346,7 @@ schema = EducationSchema typeDescription = 'Details of education from some institute.' # __implements__ = ATCTContent.__implements__ - actions = ATCTContent.actions +# actions = ATCTContent.actions global_allow = False def _computeTitle(self): @@ -353,7 +361,7 @@ schema = EmploymentSchema typeDescription = 'Details of employment with some employer.' # __implements__ = ATCTContent.__implements__ - actions = ATCTContent.actions +# actions = ATCTContent.actions global_allow = False def _computeTitle(self): @@ -368,7 +376,7 @@ schema = PublicationSchema typeDescription = 'A publication with citation details.' # __implements__ = ATFile.__implements__ - actions = ATFile.actions +# actions = ATFile.actions global_allow = False def listAuthors(self): @@ -394,7 +402,7 @@ schema = SkillSchema typeDescription = 'Details of a skill.' # __implements__ = ATCTContent.__implements__ - actions = ATCTContent.actions +# actions = ATCTContent.actions global_allow = False def _computeTitle(self):