--- MPIWGWeb/MPIWGProjects.py 2005/10/10 08:42:49 1.47.2.25 +++ MPIWGWeb/MPIWGProjects.py 2005/10/10 19:10:13 1.47.2.26 @@ -700,9 +700,31 @@ class MPIWGRoot(ZSQLExtendFolder): if RESPONSE is not None: RESPONSE.redirect('manage_main') + def updatePublicationDB(self,personId=None): + """updates the publication db, i.e. copy year into the main table""" + + if personId: + founds = self.ZSQLInlineSearch(_table="publications",id=personId) + else: + founds = self.ZSQLInlineSearch(_table="publications") + + for found in founds: + if found.id_institutsbibliographie and (not found.id_institutsbibliographie ==""): + entries = self.ZSQLInlineSearch(_table="institutsbiblio",id=found.id_institutsbibliographie) + for entry in entries: + self.ZSQLChange(_table='publications',_identify='oid=%s' % entry.oid,year=entry.year) + + if found.id_gen_bib and (not found.id_gen_bib ==""): + entries = self.ZSQLInlineSearch(_table="bibliography",id=found.id_gen_bib) + for entry in entries: + self.ZSQLChange(_table='publications',_identify='oid=%s' % entry.oid,year=entry.year) + + return True + + + def updateHomepages(self,RESPONSE): """lege members an""" - self.upDateSQL('personalwww.xml') founds=self.ZSQLInlineSearch(_table='personal_www',publish_the_data='yes') project=getattr(self,'members') @@ -717,6 +739,7 @@ class MPIWGRoot(ZSQLExtendFolder): except: RESPONSE.write("

old:%s (%s,%s)

\n"%(found.username,found.name,found.vorname)) + #delete non existing @@ -733,7 +756,8 @@ class MPIWGRoot(ZSQLExtendFolder): pass self.ProjectCatalog.manage_catalogReindex(self.REQUEST,RESPONSE,self.REQUEST['URL1']) - + self.updatePublicationDB() + if RESPONSE is not None: RESPONSE.redirect('manage_main')