Diff for /MPIWGWeb/MPIWGProjects.py between versions 1.25 and 1.26

version 1.25, 2004/09/02 14:59:02 version 1.26, 2004/09/03 08:04:21
Line 362  class MPIWGRoot(ZSQLExtendFolder): Line 362  class MPIWGRoot(ZSQLExtendFolder):
                           
                           
             splitted=line.split(",")              splitted=line.split(",")
             print splitted             # print splitted
                   
             if not (splitted[0]==""):              if not (splitted[0]==""):
                 newObj=MPIWGStaff.MPIWGStaff(splitted[0],splitted[1],splitted[2])                  newObj=MPIWGStaff.MPIWGStaff(splitted[0],splitted[1],splitted[2])
                                   
                 try:                  try:
                     project._setObject(splitted[0],newObj)                      project._setObject(splitted[0],newObj)
                     print "done:",splitted[0]                      #print "done:",splitted[0]
                 except:                  except:
                     print "not done:",splitted[0]                      print "not done:",splitted[0]
                                           
Line 428  class MPIWGRoot(ZSQLExtendFolder): Line 428  class MPIWGRoot(ZSQLExtendFolder):
     def formatElementForOverview(self,element):      def formatElementForOverview(self,element):
         """format the element for output in overview"""          """format the element for output in overview"""
         if element[0]==1: #department          if element[0]==1: #department
             print element[3].getContent('xdata_05')              #print element[3].getContent('xdata_05')
             if element[3].getContent('xdata_05') == "4":              if element[3].getContent('xdata_05') == "4":
                 return """<h2><a href="%s">Ind. Research Group I: %s</a></h2>"""%(element[3].absolute_url(),element[3].getContent('WEB_title'))                  return """<h2><a href="%s">Ind. Research Group I: %s</a></h2>"""%(element[3].absolute_url()+"/index_html",element[3].getContent('WEB_title'))
             if element[3].getContent('xdata_05') == "5":              if element[3].getContent('xdata_05') == "5":
                 return """<h2><a href="%s">Ind. Research Group II: %s</a></h2>"""%(element[3].absolute_url(),element[3].getContent('WEB_title'))                  return """<h2><a href="%s">Ind. Research Group II: %s</a></h2>"""%(element[3].absolute_url()+"/index_html",element[3].getContent('WEB_title'))
                           
             return """<h2><a href="%s">Department %s: %s</a></h2>"""%(element[3].absolute_url(),element[3].getContent('xdata_05'),element[3].getContent('WEB_title'))              return """<h2><a href="%s">Department %s: %s</a></h2>"""%(element[3].absolute_url()+"/index_html",element[3].getContent('xdata_05'),element[3].getContent('WEB_title'))
   
         elif element[0]==2: #mainprojects          elif element[0]==2: #mainprojects
             return """<h3><a href="%s">%s</a></h3><p>"""%(element[3].absolute_url(),element[3].getContent('WEB_title'))              return """<h3><a href="%s">%s</a></h3><p>"""%(element[3].absolute_url()+"/index_html",element[3].getContent('WEB_title'))
   
         elif element[0]==3:          elif element[0]==3:
             return """<p><a href="%s">%s</a></p>"""%(element[3].absolute_url(),element[3].getContent('WEB_title'))              return """<p><a href="%s">%s</a></p>"""%(element[3].absolute_url()+"/index_html",element[3].getContent('WEB_title'))
                   
     def changePosition(self,treeId,select,RESPONSE=None):      def changePosition(self,treeId,select,RESPONSE=None):
         """Change Postion Entry"""          """Change Postion Entry"""
Line 524  class MPIWGRoot(ZSQLExtendFolder): Line 524  class MPIWGRoot(ZSQLExtendFolder):
   
                 if proj:                  if proj:
                     #ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8')))                      #ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8')))
                     ret.append("<a href=%s >%s</a>"%('members/'+proj[0].id,person))                      ret.append("<a href=%s >%s</a>"%('members/'+proj[0].id+'/index_html',person))
                 else:                  else:
                     #ret.append("%s"%person.encode('utf-8'))                      #ret.append("%s"%person.encode('utf-8'))
                     ret.append("%s"%person)                      ret.append("%s"%person)
Line 540  class MPIWGRoot(ZSQLExtendFolder): Line 540  class MPIWGRoot(ZSQLExtendFolder):
             if len(person)>1: #nicht nur Trennzeichen              if len(person)>1: #nicht nur Trennzeichen
                 splitted=person.split(",")                  splitted=person.split(",")
                 if len(splitted)==1:                  if len(splitted)==1:
                     splitted=person.split(" ")                      splitted=person.lstrip().rstrip().split(" ")
                 splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted]                  splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted]
                 if splittedNew[0]=='':                  if splittedNew[0]=='':
                     del splittedNew[0]                      del splittedNew[0]
Line 555  class MPIWGRoot(ZSQLExtendFolder): Line 555  class MPIWGRoot(ZSQLExtendFolder):
   
                 if proj:                  if proj:
                     #ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8')))                      #ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person.encode('utf-8')))
                     ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url,person))                      ret.append("<a href=%s >%s</a>"%(proj[0].absolute_url+"/index_html",person))
                 else:                  else:
                     #ret.append("%s"%person.encode('utf-8'))                      #ret.append("%s"%person.encode('utf-8'))
                     ret.append("%s"%person)                      ret.append("%s"%person)
Line 619  class MPIWGRoot(ZSQLExtendFolder): Line 619  class MPIWGRoot(ZSQLExtendFolder):
                   
         splitted=name.split(",")          splitted=name.split(",")
         if len(splitted)==1:          if len(splitted)==1:
             splitted=name.split(" ")              splitted=name.lstrip().rstrip().split(" ")
         splittedNew=[re.sub(r'\s(.*)','$1',split) for split in splitted]          splittedNew=[split.lstrip() for split in splitted]
           
         if splittedNew[0]=='':          if splittedNew[0]=='':
             del splittedNew[0]              del splittedNew[0]
         search=string.join(splittedNew,' AND ')          search=string.join(splittedNew,' AND ')

Removed from v.1.25  
changed lines
  Added in v.1.26


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