--- MPIWGWeb/bibliography.py 2005/05/09 10:01:54 1.7
+++ MPIWGWeb/bibliography.py 2005/10/11 13:14:01 1.7.2.2
@@ -1,4 +1,4 @@
-
+#TO DO author_semi_kolon etc. ersetzen durch Funktionen
def formatBibliography(self,found):
ret=""
if found.id_institutsbibliographie and (not found.id_institutsbibliographie==''):
@@ -7,22 +7,29 @@ def formatBibliography(self,found):
ret+=formatBiblHelp(self,found,table='bibliography',id=found.id_gen_bib)
return ret
+def CRListToSemicolon(list):
+ if list:
+ return "; ".join(list.split("\n"))
+ else:
+ return None
+
def getBib(value):
if value:
return value
else:
return ""
-def formatBiblHelp(self,found,table,id):
+def formatBiblHelp(self,found,table,id,foundIB=None):
ret=""
- try:
- foundIB=self.ZSQLInlineSearch(_table=table,id=id)[0]
+ if not foundIB:
+ try:
+ foundIB=self.ZSQLInlineSearch(_table=table,id=id)[0]
- except:
- return ret
+ except:
+ return ret
if foundIB.reference_type.lower()=='journal article':
- ret+=getBib(foundIB.author_semi_colon)+". ""+getBib(foundIB.title)+". " "+"%s"%getBib(foundIB.secondary_title)+" "+getBib(foundIB.volume)+" ("
+ ret+=getBib(CRListToSemicolon(foundIB.author))+". ""+getBib(foundIB.title)+". " "+"%s"%getBib(foundIB.secondary_title)+" "+getBib(foundIB.volume)+" ("
if not self.ZSQLisEmpty(foundIB.number):
ret+=foundIB.number+" "
ret+=foundIB.year+")"
@@ -30,7 +37,7 @@ def formatBiblHelp(self,found,table,id):
ret+=": "+foundIB.pages+"."
elif foundIB.reference_type.lower()=='edited book':
- ret+=foundIB.author_semi_colon+" (Editor/s). "+foundIB.title+"."
+ ret+=CRListToSemicolon(foundIB.author)+" (Editor/s). "+foundIB.title+"."
if foundIB.place_published and (not foundIB.place_published==''):
ret+=foundIB.place_published+": "
if foundIB.publisher and (not foundIB.publisher==''):
@@ -38,11 +45,11 @@ def formatBiblHelp(self,found,table,id):
ret+=foundIB.year+"."
elif foundIB.reference_type.lower()=='book section':
- ret+=getBib(foundIB.author_semi_colon)+". ""+getBib(foundIB.title)+"." In "+getBib(foundIB.secondary_title)+""
- if (foundIB.secondary_author_semi_colon) and (not foundIB.secondary_author_semi_colon==''):
- ret+=", eds.: "+foundIB.secondary_author_semi_colon
+ ret+=getBib(CRListToSemicolon(foundIB.author))+". ""+getBib(foundIB.title)+"." In "+getBib(foundIB.secondary_title)+""
+ if (CRListToSemicolon(foundIB.secondary_author)) and (not CRListToSemicolon(foundIB.secondary_author)==''):
+ ret+=", eds.: "+CRListToSemicolon(foundIB.secondary_author)
ret+=". "
- if foundIB.pages and (not foundIB.pages)=='':
+ if foundIB.pages and (not foundIB.pages)=='':
ret+=foundIB.pages+". "
if foundIB.place_published and (not foundIB.place_published==''):
ret+=foundIB.place_published+": "
@@ -50,19 +57,19 @@ def formatBiblHelp(self,found,table,id):
ret+=foundIB.publisher+", "
ret+=foundIB.year+"."
elif foundIB.reference_type.lower()=='book':
- ret+=foundIB.author_semi_colon+". "+foundIB.title+". "
+ ret+=getBib(CRListToSemicolon(foundIB.author))+". "+getBib(foundIB.title)+". "
if foundIB.pages and (not foundIB.pages==''):
ret+=foundIB.pages+". "
- if not foundIB.place_published=='':
+ if foundIB.place_published and (not foundIB.place_published==''):
ret+=foundIB.place_published+": "
- if not foundIB.publisher=='':
+ if foundIB.publisher and (not foundIB.publisher==''):
ret+=foundIB.publisher+", "
- ret+=foundIB.year+"."
+ ret+=getBib(foundIB.year)+"."
elif foundIB.reference_type.lower()=='newspaper article':
- ret+=foundIB.author_semi_colon+". ""+foundIB.title+"." "+foundIB.secondary_title+", "
+ ret+=CRListToSemicolon(foundIB.author)+". ""+foundIB.title+"." "+foundIB.secondary_title+", "
ret+=foundIB.date+"."+foundIB.year+","
- if not foundIB.pages=='':
+ if foundIB.pages and (not foundIB.pages==''):
ret+=foundIB.pages+". "