--- MPIWGWeb/MPIWGStaff.py 2008/08/26 14:00:42 1.10.2.49 +++ MPIWGWeb/MPIWGStaff.py 2008/08/26 15:01:41 1.10.2.50 @@ -17,7 +17,7 @@ from Globals import package_home from Products.PythonScripts.standard import sql_quote from types import * from AccessControl import ClassSecurityInfo - +import time import logging #ersetzt logging @@ -82,6 +82,17 @@ class MPIWGStaff(CatalogAware,ZSQLExtend departmentList=departmentList security=ClassSecurityInfo() + def redirect(self,RESPONSE,url): + """mache ein redirect mit einem angehaengten time stamp um ein reload zu erzwingen""" + + timeStamp=time.time() + + if url.find("?")>-1: #giebt es schon parameter + addStr="&time=%s" + else: + addStr="?time=%s" + RESPONSE.redirect(url+addStr%timeStamp) + def getKey(self): """get database key""" if hasattr(self,'key'): @@ -138,7 +149,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.publicationSelectionMode=publicationSelectionMode if RESPONSE: - RESPONSE.redirect("editPublications") + self.redirect(RESPONSE,"editPublications") def downloadCV(self,RESPONSE): @@ -201,7 +212,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend cvFile.addContentObject("","",file=publications_pdf) if RESPONSE: - RESPONSE.redirect(self.REQUEST['HTTP_REFERER']) + self.redirect(RESPONSE,self.REQUEST['HTTP_REFERER']) def getPublishImage(self): @@ -229,7 +240,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.publishImage=publishImage if RESPONSE: - RESPONSE.redirect("edit") + self.redirect(RESPONSE,"edit") def getImageFolder(self): """getImageFolder""" @@ -314,7 +325,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.specialPublicationsField=specialPublicationsField[0:] if RESPONSE is not None: - RESPONSE.redirect('manage_main') + self.redirect(RESPONSE,'manage_main') def publications_full(self): @@ -347,7 +358,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.key = key if RESPONSE is not None: - RESPONSE.redirect('manage_main') + self.redirect(RESPONSE,'manage_main') security.declareProtected('View management screens','edit') def edit(self): @@ -385,10 +396,10 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.ZSQLQuery(query%(self.ZSQLQuote(publish),key)) if RESPONSE: - RESPONSE.redirect("edit") + self.redirect(RESPONSE,"edit") security.declareProtected('View management screens','changeResearch') - def changeResearch(self,noredirect=None): + def changeResearch(self,noredirect=None,RESPONSE=None): """change the research entries""" newEntries={} key_main=self.REQUEST.form['key_main'] @@ -437,7 +448,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.ZSQLQuery(query) if not noredirect: - self.REQUEST.RESPONSE.redirect(self.REQUEST['HTTP_REFERER']) + self.redirect(RESPONSE,self.REQUEST['HTTP_REFERER']) security.declareProtected('View management screens','editCV') def editCV(self,cv=None,oid=None,RESPONSE=None): @@ -452,7 +463,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.ZSQLQuery(query%(self.ZSQLQuote(cv),oid)) if RESPONSE: - RESPONSE.redirect("editCV") + self.redirect(RESPONSE,"editCV") def getProfile(self): @@ -493,7 +504,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend if preview: #TODO: not supported yet if RESPONSE: - RESPONSE.redirect("editProfile") + self.redirect(RESPONSE,"editProfile") #return self.preview(newcontent) @@ -501,7 +512,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.ZSQLQuery(query%(self.ZSQLQuote(newcontent),oid)) logging.error("PROFILE:"+query%(self.ZSQLQuote(newcontent),oid)) if RESPONSE: - RESPONSE.redirect("editProfile") + self.redirect(RESPONSE,"editProfile") @@ -553,7 +564,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.ZSQLQuery(query%(self.ZSQLQuote(awards),oid)) if RESPONSE: - RESPONSE.redirect("editAwards") + self.redirect(RESPONSE,"editAwards") security.declareProtected('View management screens','editTalks') def editTalks(self): @@ -587,7 +598,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend else: self.ZSQLChange(argv,_table="personal_www",_identify="key=%s"%self.getKey(),USE_FORM="yes") if RESPONSE: - RESPONSE.redirect("editMainData") + self.redirect(RESPONSE,"editMainData") security.declareProtected('View management screens','newBibliogrpaphy') def newBibliography(self,_docType=None, _addEntry=None,RESPONSE=None,**argv): @@ -617,7 +628,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend if RESPONSE: - RESPONSE.redirect("editPublications") + self.redirect(RESPONSE,"editPublications") return True @@ -646,7 +657,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend self.sortingMode=sortingMode if RESPONSE and REQUEST: - REQUEST.RESPONSE.redirect(REQUEST['HTTP_REFERER']) + REQUEST.self.redirect(RESPONSE,REQUEST['HTTP_REFERER']) return True @@ -665,16 +676,16 @@ class MPIWGStaff(CatalogAware,ZSQLExtend return 0 security.declareProtected('View management screens','changePublications') - def changePublications(self): + def changePublications(self,RESPONSE=None): """change the publication list""" self.changeResearch(noredirect=True) #self.updatePublicationDB(personId=self.getDBId()) - self.REQUEST.RESPONSE.redirect(self.REQUEST['HTTP_REFERER']) + self.redirect(RESPONSE,self.REQUEST['HTTP_REFERER']) security.declareProtected('View management screens','addPublications') - def addPublications(self,submit=None,REQUEST=None,noredirect=None): + def addPublications(self,submit=None,REQUEST=None,noredirect=None,RESPONSE=None): """add publications""" #setzte flag ob aufruf aus suchformular @@ -706,7 +717,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend if not noredirect: - self.REQUEST.RESPONSE.redirect("./editPublications") + self.redirect(RESPONSE,"./editPublications") return True @@ -792,7 +803,7 @@ class MPIWGStaff(CatalogAware,ZSQLExtend query="DELETE FROM %s WHERE oid = '%s'"%(table,oid) self.ZSQLQuery(query) - self.REQUEST.RESPONSE.redirect(self.REQUEST['HTTP_REFERER']) + self.REQUEST.self.redirect(RESPONSE,self.REQUEST['HTTP_REFERER']) def manage_addMPIWGStaffForm(self): @@ -808,6 +819,6 @@ def manage_addMPIWGStaff(self,id,lastNam if RESPONSE is not None: - RESPONSE.redirect('manage_main') + self.redirect(RESPONSE,'manage_main')