Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.47.2.9 and 1.47.2.10

version 1.47.2.9, 2005/06/05 22:06:35 version 1.47.2.10, 2005/06/06 14:51:47
Line 418  class MPIWGRoot(ZSQLExtendFolder): Line 418  class MPIWGRoot(ZSQLExtendFolder):
   
     def getProjectsByFieldContent(self,fieldName,fieldContentsEntry):      def getProjectsByFieldContent(self,fieldName,fieldContentsEntry):
         """gib alle Projekte aus mit Value von field mit fieldName enthält ein Element der Liste fieldContents"""          """gib alle Projekte aus mit Value von field mit fieldName enthält ein Element der Liste fieldContents"""
           def sort(x,y):
           return cmp(x.WEB_title[0],y.WEB_title[0])
   
         if type(fieldContentsEntry) is StringType:          if type(fieldContentsEntry) is StringType:
             fieldContents=[fieldContentsEntry]              fieldContents=[fieldContentsEntry]
         else:          else:
Line 425  class MPIWGRoot(ZSQLExtendFolder): Line 428  class MPIWGRoot(ZSQLExtendFolder):
                           
         projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' OR')})          projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' OR')})
         #print projects          #print projects
         return projects      ret=[x for x in projects]
       ret.sort(sort)
           return ret
   
     def changeMPIWGRootForm(self):      def changeMPIWGRootForm(self):
         """edit"""          """edit"""
Line 652  class MPIWGRoot(ZSQLExtendFolder): Line 657  class MPIWGRoot(ZSQLExtendFolder):
             if (element[0]>actualDepth):              if (element[0]>actualDepth):
                 #fuege soviele ul ein wie unterschied in tiefe                  #fuege soviele ul ein wie unterschied in tiefe
                 if element[0]==1:                  if element[0]==1:
                     ret+="""<div class="dept">\n<ul>\n"""                      ret+="""<div class="dept">\n<ul class="liste">\n"""
                 else:                  else:
                     for i in range(element[0]-actualDepth):                      for i in range(element[0]-actualDepth):
                         ret+="</li>\n<li><ul>\n"                          ret+="""<ul class="liste">\n"""
                                           
                 actualDepth=element[0]                  actualDepth=element[0]
                                   
             elif (element[0]<actualDepth):              elif (element[0]<actualDepth):
                 #fuege soviele /ul ein wie unterschied in tiefe                  #fuege soviele /ul ein wie unterschied in tiefe
                 for i in range(-element[0]+actualDepth):                  for i in range(-element[0]+actualDepth):
                     ret+="<br><br></li></ul></li>\n"                      ret+="<br><br>\n</li>\n</ul>\n</li>\n"
   
                 if element[0]==1:                  if element[0]==1:
                     department=int(element[3].getContent('xdata_05'))-1                      department=int(element[3].getContent('xdata_05'))-1
                                           
                     ret+="""</div>\n"""                      ret+="""</ul></div>\n"""
                     ret+="""<div class="bildspalte"><img src="../grafik/dept%i.jpg" width="160" height="120" vspace="40"></div>                      ret+="""<div class="bildspalte"><img src="../grafik/dept%i.jpg" width="160" height="120" vspace="40"></div>
                     <div class="dept">\n<ul>\n                      <div class="dept">\n<ul class="liste">\n
                     """%department                      """%department
                           
                 actualDepth=element[0]                  actualDepth=element[0]
             else:              else:
                 ret+="""</li>\n"""                  ret+="""\n</li>\n"""
             ret+="""<li>\n"""              ret+="""<li>\n"""
                           
             if actualDepth==1:              if actualDepth==1:
                 departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'NWG','5':'NWG'}                   departmentName={'1':'Department I','2':'Department II','3':'Department III', '4':'NWG','5':'NWG'} 
                 department=element[3].getContent('xdata_05')                  department=element[3].getContent('xdata_05')
                 ret+="""<img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])                  ret+="""<a href="#top"><img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])
   
             ret+="""<a href="%s">%s</a>"""%(self.generateUrlProject(element[3].absolute_url())+"/index.html",element[3].getContent('WEB_title'))              ret+="""<a href="%s">%s</a>"""%(self.generateUrlProject(element[3].absolute_url())+"/index.html",element[3].getContent('WEB_title'))
         return ret          return ret
Line 1192  class MPIWGProject(CatalogAware,Folder): Line 1197  class MPIWGProject(CatalogAware,Folder):
             splitted=text2.split("""<p class="picture">""")              splitted=text2.split("""<p class="picture">""")
             if len(splitted)>1:              if len(splitted)>1:
                 tmp=splitted[1].split("</p>")                  tmp=splitted[1].split("</p>")
           #return repr(splitted[1])
                   try:
                 self.REQUEST.SESSION['image']=tmp[0].split("\"")[1].encode('utf-8')                  self.REQUEST.SESSION['image']=tmp[0].split("\"")[1].encode('utf-8')
           except:
               self.REQUEST.SESSION['image']=tmp[0].split("src=")[1].split(" ")[0].encode('utf-8')
                 split2="</p>".join(tmp[1:])                  split2="</p>".join(tmp[1:])
   
                 text3=splitted[0]+split2                  text3=splitted[0]+split2

Removed from v.1.47.2.9  
changed lines
  Added in v.1.47.2.10


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