Diff for /ZSQLExtend/ZSQLExtend.py between versions 1.6 and 1.9

version 1.6, 2004/01/22 09:18:49 version 1.9, 2004/02/05 10:29:56
Line 18  class ZSQLExtendFolder(Persistent, Impli Line 18  class ZSQLExtendFolder(Persistent, Impli
     """Folder"""      """Folder"""
     meta_type="ZSQLExtendFolder"      meta_type="ZSQLExtendFolder"
           
       def actualPath(self,url=None):
       """path"""
       if not url:
           return "http://"+self.REQUEST['HTTP_X_FORWARDED_SERVER']+self.REQUEST['PATH_TRANSLATED']
           else:
           temp=self.REQUEST[url].split("/")
           temp[2]=self.REQUEST['HTTP_X_FORWARDED_SERVER']
           return string.join(temp,"/")
   
       def getRequest(self):
       """request"""
       return self.REQUEST
   
     def lowerEnd(self,path):      def lowerEnd(self,path):
         """oinly for demo"""          """oinly for demo"""
Line 25  class ZSQLExtendFolder(Persistent, Impli Line 37  class ZSQLExtendFolder(Persistent, Impli
                   
     def ZSQLisEmpty(self,field):      def ZSQLisEmpty(self,field):
         """Teste ob Treffer leer"""          """Teste ob Treffer leer"""
         print "field",field          #print "field",field
         if not field:          if not field:
             return 1              return 1
         if field=="":          if field=="":
Line 38  class ZSQLExtendFolder(Persistent, Impli Line 50  class ZSQLExtendFolder(Persistent, Impli
         ret="""<select name="-op_%s">          ret="""<select name="-op_%s">
     <option value="bw">begins with</option>             <!-- begins with / beginnt mit, "Wort*" -->      <option value="bw">begins with</option>             <!-- begins with / beginnt mit, "Wort*" -->
     <option value="ew">ends with</option>      <option value="ew">ends with</option>
     <option value="ct">contains</option>                <!-- contains / enthaellt, "Wort" -->      <option value="ct" selected>contains</option>               <!-- contains / enthaellt, "Wort" -->
     <option value="eq">equals</option>                  <!-- equals / ist, =Wort -->      <option value="eq">equals</option>                  <!-- equals / ist, =Wort -->
 </select>"""%fieldname  </select>"""%fieldname
         return ret          return ret
Line 341  class ZSQLExtendFolder(Persistent, Impli Line 353  class ZSQLExtendFolder(Persistent, Impli
         if not nostore=="yes":          if not nostore=="yes":
                           
             self.REQUEST.SESSION['qs']=opfields              self.REQUEST.SESSION['qs']=opfields
         print "IAMHERE again:", query          #print "IAMHERE again:", query
   
         if storename:          if storename:
             query2="SELECT count(%s) FROM %s %s"%(select,table,where)              query2="SELECT count(*) FROM %s %s"%(table,where)
             #print "storing",query2              #print "storing",query2
             #print "QUERYSTRING:",self.REQUEST.SESSION[storename]['queryString2']              #print "QUERYSTRING:",self.REQUEST.SESSION[storename]['queryString2']
             if not self.REQUEST.SESSION.has_key(storename):              if not self.REQUEST.SESSION.has_key(storename):
Line 370  class ZSQLExtendFolder(Persistent, Impli Line 382  class ZSQLExtendFolder(Persistent, Impli
                 self.REQUEST.SESSION[storename]['rangeEnd']=int(rangeStart)+int(limit)                  self.REQUEST.SESSION[storename]['rangeEnd']=int(rangeStart)+int(limit)
             self.REQUEST.SESSION[storename]['rangeSize']=limit              self.REQUEST.SESSION[storename]['rangeSize']=limit
                           
     print query                  #print query            
         return self.search(var=query)          return self.search(var=query)
           
     def ZSQLSearch(self):      def ZSQLSearch(self):
Line 443  class ZSQLExtendFolder(Persistent, Impli Line 455  class ZSQLExtendFolder(Persistent, Impli
             newquery.append(query)              newquery.append(query)
                                   
         newquerystring=string.join(newquery,"&")          newquerystring=string.join(newquery,"&")
         return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html)      
           return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html)
                           
                   
     def prevLink(self,html,storename="foundCount"):      def prevLink(self,html,storename="foundCount"):
Line 494  class ZSQLExtendFolder(Persistent, Impli Line 507  class ZSQLExtendFolder(Persistent, Impli
             newquery.append(query)              newquery.append(query)
                           
         newquerystring=string.join(newquery,"&")          newquerystring=string.join(newquery,"&")
         return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html)  
           return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html)
   
   
           
     def prevLink_old(self,html):      def prevLink_old(self,html):
         """prev link"""          """prev link"""
Line 521  class ZSQLExtendFolder(Persistent, Impli Line 537  class ZSQLExtendFolder(Persistent, Impli
         else:          else:
             queries.append("-offset=%i"%offsetnew)              queries.append("-offset=%i"%offsetnew)
             newquerystring=string.join(queries,"&")              newquerystring=string.join(queries,"&")
         return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html)          return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html)
                   
     def nextLink_old(self,html):      def nextLink_old(self,html):
         """prev link"""          """prev link"""
Line 551  class ZSQLExtendFolder(Persistent, Impli Line 567  class ZSQLExtendFolder(Persistent, Impli
             queries.append("-offset=%i"%offsetnew)              queries.append("-offset=%i"%offsetnew)
             newquerystring=string.join(queries,"&")              newquerystring=string.join(queries,"&")
                   
         return "<a href='%s'>%s</a>"%(self.REQUEST['URL0']+"?"+newquerystring,html)          return "<a href='%s'>%s</a>"%(self.actualPath()+"?"+newquerystring,html)
                   
           
 manage_addZSQLExtendFolderForm=DTMLFile('ZSQLExtendFolderAdd', globals())  manage_addZSQLExtendFolderForm=DTMLFile('ZSQLExtendFolderAdd', globals())

Removed from v.1.6  
changed lines
  Added in v.1.9


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