Diff for /MPIWGWeb/MPIWGStaff.py between versions 1.10.2.62 and 1.10.2.76

version 1.10.2.62, 2008/10/22 11:27:42 version 1.10.2.76, 2011/05/18 12:36:06
Line 35  def logger(txt,method,txt2): Line 35  def logger(txt,method,txt2):
 departmentList="Renn\nRheinberger\nDaston\nKlein\nSibum\nIT\nInstitut\nBibliothek"  departmentList="Renn\nRheinberger\nDaston\nKlein\nSibum\nIT\nInstitut\nBibliothek"
   
   
 def getTemplate(self, tpName):  
     """get a template file either form the instance or from the product"""  
     ext=self.ZopeFind(self.aq_parent,obj_ids=[tpName])  
     if ext:  
         pt = getattr(self,ext[0][1].getId())  
     else:  
         pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/'+tpName)).__of__(self)  
     assert(pt)  
     return pt  
   
 def createNewDBEntry(self,publish_the_data,key,name,vorname,title,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by="",e_mail2="",txt="",txt_p="no",stay_at_mpiwg="",group="",web_object_created="no",current_work=""):  
   def createNewDBEntry(self,publish_the_data,key,name,vorname,titles_new,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by="",e_mail2="",txt="",txt_p="no",stay_at_mpiwg="",group="",web_object_created="no",current_work=""):
         """lege person in der datenbank an"""          """lege person in der datenbank an"""
   
         if date_to=="": # wenn date_to leer          if date_to=="": # wenn date_to leer
Line 59  def createNewDBEntry(self,publish_the_da Line 51  def createNewDBEntry(self,publish_the_da
             return False,"ERROR:key%s already exists"%key              return False,"ERROR:key%s already exists"%key
                   
         #eintragen          #eintragen
         columnlist="""publish_the_data,key,last_name,first_name,title,status,e_mail,e_mail_p,date_from,date_to,department,home_inst,funded_by,e_mail2,date_stay_at_mpiwg,web_object_created,"group",current_work,current_work_p """          columnlist="""publish_the_data,key,last_name,first_name,titles_new,status,e_mail,e_mail_p,date_from,date_to,department,home_inst,funded_by,e_mail2,date_stay_at_mpiwg,web_object_created,"group",current_work,current_work_p """
         insertTuple=(publish_the_data,key,name,vorname,title,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg,web_object_created,group,current_work,"yes")          insertTuple=(publish_the_data,key,name,vorname,titles_new,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg,web_object_created,group,current_work,"yes")
                   
         insert=[]          insert=[]
         for element in insertTuple:          for element in insertTuple:
Line 107  class MPIWGStaff(CatalogAware,ZSQLExtend Line 99  class MPIWGStaff(CatalogAware,ZSQLExtend
         """get db_key utf8"""          """get db_key utf8"""
         return utf8ify(self.getKey())          return utf8ify(self.getKey())
           
       def setKey(self,key):
       """set key"""
       self.key=key
   
     def getKey(self):      def getKey(self):
         """get database key"""          """get database key"""
         if hasattr(self,'key'):          if hasattr(self,'key'):
Line 120  class MPIWGStaff(CatalogAware,ZSQLExtend Line 116  class MPIWGStaff(CatalogAware,ZSQLExtend
                   
     def getConnectionObj(self):      def getConnectionObj(self):
          """returns connection id (from root)"""           """returns connection id (from root)"""
            try:
          root = self.getMPIWGRoot()           root = self.getMPIWGRoot()
          return root.getConnectionObj()           return root.getConnectionObj()
            except:
                return self.en.getConnectionObj()
                   
     def isPublished(self):      def isPublished(self):
         """gib publications status aus der datenbank aus"""          """gib publications status aus der datenbank aus"""
Line 237  class MPIWGStaff(CatalogAware,ZSQLExtend Line 236  class MPIWGStaff(CatalogAware,ZSQLExtend
         """publish the image??, default no"""          """publish the image??, default no"""
         return getattr(self,'publishImage','no')          return getattr(self,'publishImage','no')
           
     def updateImage(self,file,publishImage,rename=None,RESPONSE=None):      def updateImage(self,publishImage,file=None,rename=None,RESPONSE=None):
         """update image"""          """update image"""
   
         if file and not(file.filename==""):          if file and not(file.filename==""):
Line 341  class MPIWGStaff(CatalogAware,ZSQLExtend Line 340  class MPIWGStaff(CatalogAware,ZSQLExtend
         """harvest"""          """harvest"""
         if not self.isPublished():          if not self.isPublished():
             return ""              return ""
         return getattr(self.en.staff.members,self.getId()).index_html()          st = getattr(self.en.staff.members,self.getId()).index_html()
       return st
                   
           
     def index_html(self):      def index_html(self):
Line 370  class MPIWGStaff(CatalogAware,ZSQLExtend Line 370  class MPIWGStaff(CatalogAware,ZSQLExtend
                 # Got a cached value.                  # Got a cached value.
                 return result                  return result
               
           # look for individual page
           if self.hasObject("index.html"):
               pt = getattr(self, "index.html")
           # else use template
           else:
         pt = getTemplate(self, "members_main")          pt = getTemplate(self, "members_main")
          # Execute the template in a new security context.           # Execute the template in a new security context.
         security.addContext(self)          security.addContext(self)
Line 451  class MPIWGStaff(CatalogAware,ZSQLExtend Line 456  class MPIWGStaff(CatalogAware,ZSQLExtend
         pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMPIWGStaff.zpt')).__of__(self)          pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMPIWGStaff.zpt')).__of__(self)
                   
                   
         logging.error("XX:"+email.Utils.formatdate().split("-")[0]+'GMT')          logging.debug("XX:"+email.Utils.formatdate().split("-")[0]+'GMT')
         return pt()          return pt()
   
     mainEditFile=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMPIWGStaff_main.zpt'))      mainEditFile=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMPIWGStaff_main.zpt'))
Line 580  class MPIWGStaff(CatalogAware,ZSQLExtend Line 585  class MPIWGStaff(CatalogAware,ZSQLExtend
         """get the profile"""          """get the profile"""
     self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT')      self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT')
               
         founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKey())          founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKeyUTF8())
         html="""<html><body>%s</body></html>"""          html="""<html><body>%s</body></html>"""
         if founds.profile and founds.profile != "":          if founds.profile and founds.profile != "":
                         
Line 632  class MPIWGStaff(CatalogAware,ZSQLExtend Line 637  class MPIWGStaff(CatalogAware,ZSQLExtend
         """erzeugt ein automatisches Profil aus den alten Eintraegen  CV, Current work, und research interests"""          """erzeugt ein automatisches Profil aus den alten Eintraegen  CV, Current work, und research interests"""
                   
         ret=""          ret=""
           #founds=self.ZSQLInlineSearch(_table='research_interest',key_main=person.getKeyUTF8())
         founds=self.ZSQLInlineSearch(_table='research_interest',key_main=person.key)          founds=self.ZSQLInlineSearch(_table='research_interest',key_main=person.key)
         if founds:          if founds:
             ret="<p class=\"bio_section_header\">Research interests: </p><br/>"              ret="<p class=\"bio_section_header\">Research interests: </p><br/>"
Line 708  class MPIWGStaff(CatalogAware,ZSQLExtend Line 714  class MPIWGStaff(CatalogAware,ZSQLExtend
             pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMainData.zpt')).__of__(self)              pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editMainData.zpt')).__of__(self)
             return pt()               return pt() 
         else:          else:
             self.ZSQLChange(argv,_table="personal_www",_identify="key=%s"%self.getKey(),USE_FORM="yes")              self.ZSQLChange(argv,_table="personal_www",_identify="lower(key)=%s"%utf8ify(self.getKey().lower()),USE_FORM="yes")
             if RESPONSE:              if RESPONSE:
                 self.redirect(RESPONSE,"editMainData")                  self.redirect(RESPONSE,"editMainData")
                                   

Removed from v.1.10.2.62  
changed lines
  Added in v.1.10.2.76


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