version 1.10.2.42, 2008/08/20 06:26:27
|
version 1.10.2.43, 2008/08/20 09:40:57
|
Line 439 class MPIWGStaff(CatalogAware,ZSQLExtend
|
Line 439 class MPIWGStaff(CatalogAware,ZSQLExtend
|
if RESPONSE: |
if RESPONSE: |
RESPONSE.redirect("editCV") |
RESPONSE.redirect("editCV") |
|
|
|
|
|
def getProfile(self): |
|
"""get the profile""" |
|
founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKey()) |
|
html="""<html><body>%s</body></html>""" |
|
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("<body>") |
|
end=kupu.find("</body>") |
|
|
|
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: <br/><br/>" |
|
for found in self.sortPriority(founds): |
|
ret+=found.interest+"<br/>" |
|
|
|
founds=self.ZSQLInlineSearch(_table='current_work',key_main=person.key) |
|
if founds: |
|
ret="Current work: <br/><br/>" |
|
for found in self.sortPriority(founds): |
|
ret+=found.current+"<br/>" |
|
|
|
ret+="<br/>" |
|
ret+=self.formatAscii(person.cv) |
|
|
|
return ret |
security.declareProtected('View management screens','editDownloads') |
security.declareProtected('View management screens','editDownloads') |
def editDownloads(self): |
def editDownloads(self): |
"""editiere die Downloads von der Webseite""" |
"""editiere die Downloads von der Webseite""" |