Diff for /versionedFile/extVersionedFile.py between versions 1.29 and 1.31

version 1.29, 2008/10/09 07:44:34 version 1.31, 2009/06/05 07:32:17
Line 1018  class extVersionedFile(CatalogAware,Fold Line 1018  class extVersionedFile(CatalogAware,Fold
         #return "File: %s Version:%i modified:%s size:%s modified by:%s"%(self.title,lastVersion.versionNumber,lastVersion.getTime(),lastVersion.getSize(),lastVersion.lastEditor())          #return "File: %s Version:%i modified:%s size:%s modified by:%s"%(self.title,lastVersion.versionNumber,lastVersion.getTime(),lastVersion.getSize(),lastVersion.lastEditor())
         return self.history()          return self.history()
   
       def getVersionNr(self,nr):
           """get version with number nr"""
           tmp=0
           lastVersion=None
           
           
           for version in self.ZopeFind(self):
               
               if hasattr(version[1],'versionNumber'):
                   
                   if int(version[1].versionNumber) ==nr :
                       return version[1]
           
           return None
     security.declarePublic('getVersion')                                                    security.declarePublic('getVersion')                                              
     def getVersion(self):      def getVersion(self):
         # TODO: this is ugly and it returns the next version number           # TODO: this is ugly and it returns the next version number 
Line 1063  class extVersionedFile(CatalogAware,Fold Line 1076  class extVersionedFile(CatalogAware,Fold
         return vl          return vl
   
     security.declareProtected('AUTHENTICATED_USER','forceunlock')         security.declareProtected('AUTHENTICATED_USER','forceunlock')   
     def forceunlock(self,RESPONSE=None):      def forceunlock(self,RESPONSE=None,user=None):
         """unlock"""          """unlock"""
         #safe who had the lock          #safe who had the lock
           logging.debug("extVersionFile: (forceunlock)"+str(user))
         if self.lockedBy:          if self.lockedBy:
               if user is not None:
                   if str(self.lockedBy)==user:
             self.brokenLock=str(self.lockedBy)              self.brokenLock=str(self.lockedBy)
                       self.lockedBy=''
         else:          else:
             self.brokenLock=""              self.brokenLock=""
               else:
                   self.brokenLock=str(self.lockedBy)
         self.lockedBy=''          self.lockedBy=''
           else:
               self.brokenLock=""
           
         return self.brokenLock          return self.brokenLock
   
     security.declareProtected('AUTHENTICATED_USER','unlock')         security.declareProtected('AUTHENTICATED_USER','unlock')   

Removed from v.1.29  
changed lines
  Added in v.1.31


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>