--- MPIWGWeb/MPIWGProjects.py 2005/10/10 08:42:49 1.47.2.25 +++ MPIWGWeb/MPIWGProjects.py 2005/10/11 13:14:01 1.47.2.27 @@ -700,9 +700,32 @@ 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_main=personId) + else: + founds = self.ZSQLInlineSearch(_table="publications") + + for found in founds: + print found + 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' % found.oid,year=entry.year,referencetype=entry.reference_type) + + 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' % found.oid,year=entry.year,referencetype=entry.reference_type) + + 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 +740,7 @@ class MPIWGRoot(ZSQLExtendFolder): except: RESPONSE.write("

old:%s (%s,%s)

\n"%(found.username,found.name,found.vorname)) + #delete non existing @@ -733,7 +757,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')