--- MPIWGWeb/MPIWGStaff.py 2005/11/11 15:02:27 1.10.2.16 +++ MPIWGWeb/MPIWGStaff.py 2005/11/24 19:14:18 1.10.2.19 @@ -54,7 +54,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend else: return False - def createNewDBEntry(self,publish_the_data,id,name,vorname,username,title,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by="",e_mail2="",txt="",txt_p="no",stay_at_mpiwg=""): + def createNewDBEntry(self,publish_the_data,id,name,vorname,username,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=""): """lege person in der datenbank an""" msg="" #test ob id schon existiert @@ -68,8 +68,8 @@ class MPIWGStaff(CatalogAware,ZSQLExtend if self.ZSQLQuery("select username from personal_www where username='%s' and not publish_the_data='yes'"%username): msg="WARNING:username %s not unique but id=%s added"%(username,id) #eintragen - columnlist="publish_the_data,id,name,vorname,username,title,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg" - insertTuple=(publish_the_data,id,name,vorname,username,title,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg) + columnlist="publish_the_data,id,name,vorname,username,title,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg" + insertTuple=(publish_the_data,id,name,vorname,username,title,position,e_mail,e_mail_p,date_from,date_to,abteilung,heimat_inst,funded_by,e_mail2,stay_at_mpiwg) insert=[] for element in insertTuple: @@ -77,12 +77,13 @@ class MPIWGStaff(CatalogAware,ZSQLExtend insertStr=",".join(insert) queryStr="INSERT INTO personal_www (%s) VALUES (%s)"%(columnlist,insertStr) - + self.ZSQLQuery("SET DATESTYLE TO 'German'") self.ZSQLQuery(queryStr) - + #currentwork if not (txt==""): queryStr="INSERT INTO current_work (id_main,current,publish) VALUES ('%s','%s','%s')"%(id,txt,txt_p) + self.ZSQLQuery(queryStr) return True,msg @@ -313,7 +314,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend def editCV(self,cv=None,oid=None,RESPONSE=None): """edit Cv""" - if (not cv): + if (not oid): pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editCV.zpt')).__of__(self) return pt() @@ -327,13 +328,13 @@ class MPIWGStaff(CatalogAware,ZSQLExtend security.declareProtected('View management screens','editAwards') def editAwards(self,awards=None,oid=None,RESPONSE=None): """edit a awards""" - - if (not awards): + + if (not oid): pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editAwards.zpt')).__of__(self) return pt() query="UPDATE personal_www SET awards ='%s' WHERE oid='%s'" - + self.ZSQLQuery(query%(awards,oid)) if RESPONSE: @@ -476,7 +477,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend query="INSERT INTO %s " % "publications" query+="(id_main,id_institutsbibliographie,publish) " query+="VALUES ('%s','%s','yes')" %(sql_quote(self.getDBId()),sql_quote(bibId)) - print "ADD",query + #self.ZSQLAdd(_table="publications",id_institutsbibliographie=bibId,id_main=self.getDBId(),publish='yes') self.ZSQLQuery(query)