Mercurial > hg > MPIWGWeb
diff MPIWGStaff.py @ 56:a6ace48c2bf2
publication management f?r projekte
author | dwinter |
---|---|
date | Tue, 30 Apr 2013 18:35:08 +0200 |
parents | e718d9a72f19 |
children | 84879a3f91a6 |
line wrap: on
line diff
--- a/MPIWGStaff.py Tue Apr 30 16:46:32 2013 +0200 +++ b/MPIWGStaff.py Tue Apr 30 18:35:08 2013 +0200 @@ -1127,7 +1127,7 @@ return tmp - def getPublications(self,coneId="renn",limit=None,publicationType=None): + def getPublicationsFromPubman(self,coneId="renn",limit=None,publicationType=None): logging.debug("coneID:%s"%coneId) try: @@ -1595,13 +1595,13 @@ splitted = ident.split("@"); return splitted[0] - def getPublications(self,limit=None,publicationType=None): + def getPublicationsFromPubman(self,limit=None,publicationType=None): if self.content.publications_mode=="year" or publicationType is not None: coneId = self.getConeId(); if coneId: - pubs= self.folder.getPublications(coneId,limit=limit,publicationType=publicationType) + pubs= self.folder.getPublicationsFromPubman(coneId,limit=limit,publicationType=publicationType) return pubs elif self.content.publications_mode=="priority": @@ -1659,18 +1659,23 @@ for key in data.keys(): - query="INSERT INTO pubmanbiblio (key_main,escidocId) values (%s,%s)" + if key.startswith('escidoc:'): + - if data.get(key)=="add": - self.executeZSQL(query,[self.getKey(),key]) + query="INSERT INTO pubmanbiblio (key_main,escidocId) values (%s,%s)" + if data.get(key)=="add": + self.executeZSQL(query,[self.getKey(),key]) + - selectedPublications = self.getSelectedPublications() + #selectedPublications = self.getSelectedPublications() + + #pt = PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','change_publications.zpt')).__of__(self) - pt = PageTemplateFile(os.path.join(package_home(globals()),'zpt/staff/pubman','change_publications.zpt')).__of__(self) - - return pt() + #return pt() + if hasattr(self,'REQUEST'): + return self.REQUEST.response.redirect("changePublications") def changePublications(self,REQUEST): @@ -1703,12 +1708,16 @@ def setPublicationPriority(self,escidocid,value): - - query="update pubmanbiblio set priority=%s where escidocid=%s and key_main=%s" - - self.executeZSQL(query,[value,escidocid,self.getKey()]); - - + try: + query="update pubmanbiblio set priority=%s where escidocid=%s and key_main=%s" + + self.executeZSQL(query,[value,escidocid,self.getKey()]); + + except: + logging.error("couldn't change:") + logging.error(escidocid) + logging.error(value) + def getSelectedPublications(self): """hole publications aus der datenbank"""