--- versionedFile/versionedFile.py 2005/02/24 18:07:41 1.27 +++ versionedFile/versionedFile.py 2005/03/05 11:57:18 1.30 @@ -96,9 +96,11 @@ class versionedFileFolder(Folder,ECHO_ba def sortDate(x,y): return cmp(y[1].getLastVersion().getTime(),x[1].getLastVersion().getTime()) + def sortComment(x,y): + return cmp(getattr(x[1],'comment','ZZZZZZZZZZZZZ').lower(),getattr(y[1],'comment','ZZZZZZZZZZZZZ').lower()) def sortAuthor(x,y): - return cmp(x[1].getLastVersion().lastEditor(),y[1].getLastVersion().lastEditor()) + return cmp(x[1].getLastVersion().lastEditor().lower(),y[1].getLastVersion().lastEditor().lower()) versionedFiles=self.ZopeFind(self,obj_metatypes=['versionedFile']) @@ -108,6 +110,8 @@ class versionedFileFolder(Folder,ECHO_ba versionedFiles.sort(sortDate) elif sortField=='author': versionedFiles.sort(sortAuthor) + elif sortField=='comment': + versionedFiles.sort(sortComment) return versionedFiles @@ -406,6 +410,11 @@ class versionedFile(Folder): ret.sort(sortv) return ret + security.declareProtected('AUTHENTICATED_USER','forceunlock') + def forceunlock(self,RESPONSE): + """unlock""" + self.lockedBy='' + security.declareProtected('AUTHENTICATED_USER','unlock') def unlock(self,RESPONSE): """unlock""" @@ -415,6 +424,7 @@ class versionedFile(Folder): else: return "Sorry, not locked by you! (%s,%s)"%(self.lockedBy,self.REQUEST['AUTHENTICATED_USER']) + security.declareProtected('AUTHENTICATED_USER','addVersionedFileObjectForm')