--- MPIWGWeb/MPIWGStaff.py 2008/08/20 06:26:27 1.10.2.42 +++ MPIWGWeb/MPIWGStaff.py 2008/08/20 09:40:57 1.10.2.43 @@ -438,7 +438,78 @@ class MPIWGStaff(CatalogAware,ZSQLExtend if RESPONSE: RESPONSE.redirect("editCV") + + + def getProfile(self): + """get the profile""" + founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKey()) + html="""%s""" + if founds.profile and founds.profile != "": + + return html%founds.profile + else: + + return html%self.generateProfileForPerson(founds) + + def editProfile(self,oid=None,RESPONSE=None, kupu=None, preview=None): + """edit Profile, new entry replaces CD, current work and research interests""" + if (not oid): + pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','editProfile.zpt')).__of__(self) + return pt() + + + + + if preview: + pass + #TODO: not supported yet + #kupu=preview + # find content of body tags + + start=kupu.find("") + end=kupu.find("") + + newcontent= kupu[start+6:end] + + + + + if preview: + #TODO: not supported yet + if RESPONSE: + RESPONSE.redirect("editProfile") + + #return self.preview(newcontent) + + query="UPDATE personal_www SET profile=%s WHERE oid='%s'" + self.ZSQLQuery(query%(self.ZSQLQuote(newcontent),oid)) + logging.error("PROFILE:"+query%(self.ZSQLQuote(newcontent),oid)) + if RESPONSE: + RESPONSE.redirect("editProfile") + + + + def generateProfileForPerson(self,person): + """erzeugt ein automatisches Profil aus den alten Eintraegen CV, Current work, und research interests""" + + ret="" + founds=self.ZSQLInlineSearch(_table='research_interest',key_main=person.key) + if founds: + ret="Research interests:

" + for found in self.sortPriority(founds): + ret+=found.interest+"
" + + founds=self.ZSQLInlineSearch(_table='current_work',key_main=person.key) + if founds: + ret="Current work:

" + for found in self.sortPriority(founds): + ret+=found.current+"
" + + ret+="
" + ret+=self.formatAscii(person.cv) + + return ret security.declareProtected('View management screens','editDownloads') def editDownloads(self): """editiere die Downloads von der Webseite"""