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

version 1.47.2.10, 2005/06/06 14:51:47 version 1.47.2.13, 2005/06/14 12:35:55
Line 422  class MPIWGRoot(ZSQLExtendFolder): Line 422  class MPIWGRoot(ZSQLExtendFolder):
         return cmp(x.WEB_title[0],y.WEB_title[0])          return cmp(x.WEB_title[0],y.WEB_title[0])
   
     if type(fieldContentsEntry) is StringType:      if type(fieldContentsEntry) is StringType:
             fieldContents=[fieldContentsEntry]              fieldContentsTmp=[fieldContentsEntry]
         else:          else:
             fieldContents=fieldContentsEntry              fieldContentsTmp=fieldContentsEntry
                           
         projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' OR')})          fieldContents=[]
           for x in fieldContentsTmp:
               fieldContents.append(" AND ".join(x.split()))
           projects=self.ProjectCatalog({fieldName:string.join(fieldContents,' AND')})
         #print projects          #print projects
     ret=[x for x in projects]      ret=[x for x in projects]
     ret.sort(sort)      ret.sort(sort)
Line 449  class MPIWGRoot(ZSQLExtendFolder): Line 452  class MPIWGRoot(ZSQLExtendFolder):
   
     def getDisciplineList(self):      def getDisciplineList(self):
         """get disciplines as list"""          """get disciplines as list"""
         return self.disciplineList.split("\n")          list= self.disciplineList.split("\n")
           return [x.rstrip().lstrip() for x in list]
           
     def getThemeList(self):      def getThemeList(self):
         """get themes as list"""          """get themes as list"""
         return self.themesList.split("\n")          list= self.themesList.split("\n")
           return [x.rstrip().lstrip() for x in list]
           
     def test(self):      def test(self):
         """test"""          """test"""
Line 644  class MPIWGRoot(ZSQLExtendFolder): Line 649  class MPIWGRoot(ZSQLExtendFolder):
                     #title=project[0].WEB_title                      #title=project[0].WEB_title
                     title=[project[0].getContent('WEB_title')]                      title=[project[0].getContent('WEB_title')]
                     #print title                      #print title
               if idNr[0]!="x":
                     returnList.append((depth,nr,title,project[0]))                      returnList.append((depth,nr,title,project[0]))
                   
         return returnList          return returnList
Line 660  class MPIWGRoot(ZSQLExtendFolder): Line 666  class MPIWGRoot(ZSQLExtendFolder):
                     ret+="""<div class="dept">\n<ul class="liste">\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):
                           if i>0:
                               ret+="<li>"
                         ret+="""<ul class="liste">\n"""                          ret+="""<ul class="liste">\n"""
                                           
                 actualDepth=element[0]                  actualDepth=element[0]
Line 667  class MPIWGRoot(ZSQLExtendFolder): Line 675  class MPIWGRoot(ZSQLExtendFolder):
             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>\n</li>\n</ul>\n</li>\n"  
                       ret+="<br><br></li></ul>\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+="""</ul></div>\n"""                      ret+="""</ul></div>\n"""
               if department==4: #hack
               department=3
   
                     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 class="liste">\n                      <div class="dept">\n<ul class="liste">\n
                     """%department                      """%department
Line 683  class MPIWGRoot(ZSQLExtendFolder): Line 698  class MPIWGRoot(ZSQLExtendFolder):
             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':'Ind. Research Group','5':'Ind. Research Group'} 
                 department=element[3].getContent('xdata_05')                  department=element[3].getContent('xdata_05')
                 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="#top"><img src="../grafik/totop.gif" vspace="10" border="0"></a><br><a name="dept%s"></a>%s: """%(department,departmentName[department])
   
Line 1199  class MPIWGProject(CatalogAware,Folder): Line 1214  class MPIWGProject(CatalogAware,Folder):
                 tmp=splitted[1].split("</p>")                  tmp=splitted[1].split("</p>")
         #return repr(splitted[1])          #return repr(splitted[1])
                 try:                  try:
             self.REQUEST.SESSION['image']=tmp[0].split("\"")[1].encode('utf-8')              self.imageURL=tmp[0].split("\"")[1].encode('utf-8')
         except:          except:
             self.REQUEST.SESSION['image']=tmp[0].split("src=")[1].split(" ")[0].encode('utf-8')              self.imageURL=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
Line 1209  class MPIWGProject(CatalogAware,Folder): Line 1225  class MPIWGProject(CatalogAware,Folder):
                 splitted=text3.split("""<p class="picturetitle">""")                  splitted=text3.split("""<p class="picturetitle">""")
                 if len(splitted)>1:                  if len(splitted)>1:
                     tmp=splitted[1].split("</p>")                      tmp=splitted[1].split("</p>")
                     self.REQUEST.SESSION['imagecap']=tmp[0].encode('utf-8')              self.imagecap=tmp[0].encode('utf-8')
                   
                     split4="".join(tmp[1:])                      split4="".join(tmp[1:])
   
                     text5=splitted[0]+split4                      text5=splitted[0]+split4
Line 1224  class MPIWGProject(CatalogAware,Folder): Line 1241  class MPIWGProject(CatalogAware,Folder):
   
         #teste ob WEB_project_description und keine führenden p tags          #teste ob WEB_project_description und keine führenden p tags
         if (len(text5)>4) and (not text5[0:3]=='<p>') and (field=='WEB_project_description'):          if (len(text5)>4) and (not text5[0:3]=='<p>') and (field=='WEB_project_description'):
             return "<p>"+text5+"</p>"              text5= "<p>"+text5+"</p>"
   
   
         #filter image          #filter image
Line 1301  class MPIWGProject(CatalogAware,Folder): Line 1318  class MPIWGProject(CatalogAware,Folder):
         else:          else:
             splitted=list[0].split(";")              splitted=list[0].split(";")
   
           splitted=[y.rstrip().lstrip() for y in splitted]
   
         for x in splitted:          for x in splitted:
             if (not x==u'') and x in wert:              if (not x==u'') and x in wert:

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


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