Mercurial > hg > MPIWGWeb
changeset 147:6ae0201b1257
bug in edit publications. behoben
author | dwinter |
---|---|
date | Mon, 03 Jun 2013 08:24:14 +0200 |
parents | fc2480e1f30f |
children | e34232fbe622 |
files | MPIWGStaff.py zpt/staff/pubman/change_publications.zpt |
diffstat | 2 files changed, 12 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/MPIWGStaff.py Fri May 31 21:15:32 2013 +0200 +++ b/MPIWGStaff.py Mon Jun 03 08:24:14 2013 +0200 @@ -821,8 +821,8 @@ data=REQUEST.form - - if data.get("method","change"): + if data.get("method","") == "change": + for key in data.keys(): splitted=key.split("__") #format escidoc_id__p fuer priority, nur escidocid value=data[key] @@ -840,16 +840,16 @@ def deleteFromPublicationList(self,escidocid): """Loessche publication with escidoc id from publication list""" - query ="DELETE FROM pubmanbiblio WHERE escidocid=%s and key_main=%s" + query ="DELETE FROM pubmanbiblio WHERE escidocid=%s and lower(key_main)=%s" - self.executeZSQL(query,[escidocid,self.getKey()]); + self.executeZSQL(query,[escidocid,self.getKey().lower()]); def setPublicationPriority(self,escidocid,value): try: - query="update pubmanbiblio set priority=%s where escidocid=%s and key_main=%s" + query="update pubmanbiblio set priority=%s where escidocid=%s and lower(key_main)=%s" - self.executeZSQL(query,[value,escidocid,self.getKey()]); + self.executeZSQL(query,[value,escidocid,self.getKey().lower()]); except: logging.error("couldn't change:")
--- a/zpt/staff/pubman/change_publications.zpt Fri May 31 21:15:32 2013 +0200 +++ b/zpt/staff/pubman/change_publications.zpt Mon Jun 03 08:24:14 2013 +0200 @@ -12,7 +12,11 @@ <table> -<input type="hidden" method="change"/> +<input type="hidden" value="change" name="method"/> + +<tr> +<td>Delete</td><td>Priority</td><td>Citation</td> +</tr> <tr tal:repeat="entry python:here.getSelectedPublications()"> <td><input type="checkbox" value="delete" tal:attributes="name python:entry.escidocid"/></td> <td><input type="text" size="5" tal:attributes="name python:entry.escidocid+'__p'; value python:entry.priority"/></td> @@ -20,7 +24,7 @@ </tr> </table> -<input type="submit" value="submit"/> +<input type="submit" value="submit"/> <b>This will delete all selected entries and change the priorities!</b> </form>