changeset 194:45984e00665f

upload and download cv and publicationlist
author dwinter
date Thu, 20 Jun 2013 14:00:13 +0200
parents 522d32a50c2b
children 124efbedd35b
files MPIWGStaff.py zpt/staff/edit_downloads.zpt
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MPIWGStaff.py	Thu Jun 20 10:54:14 2013 +0200
+++ b/MPIWGStaff.py	Thu Jun 20 14:00:13 2013 +0200
@@ -449,13 +449,20 @@
     
     
     def downloadCV(self,REQUEST):
+        """download the cv"""
+
         fname="%s_cv.pdf"%self.getUsername().encode('utf-8')
         logging.debug(fname)
         ob=self.folder._getOb("downloadableFiles")._getOb(fname)
+      
         REQUEST.RESPONSE.redirect(ob.absolute_url())
 
     def downloadPublications(self,REQUEST):
+        """donwload the publication list"""
+        
+        
         ob=self.folder._getOb("downloadableFiles")._getOb("%s_publications.pdf"%self.getUsername().encode('utf-8'))
+        
         REQUEST.RESPONSE.redirect(ob.absolute_url())
 
 
@@ -629,7 +636,7 @@
             cvName=cvName.encode('utf-8')
             logging.debug("CCC")
             if not hasattr(ob,cvName):
-                cvFile = ExtFile(cvName,cvName)
+                cvFile = ExtFile.ExtFile(cvName,cvName)
                 ob._setObject(cvName,cvFile)
           
             cvFile = getattr(ob,cvName)
@@ -641,7 +648,7 @@
             pdfName=pdfName.encode('utf-8')
             
             if not hasattr(ob,pdfName):
-                cvFile = ExtFile(pdfName,pdfName)
+                cvFile = ExtFile.ExtFile(pdfName,pdfName)
                 ob._setObject(pdfName,cvFile)
          
             cvFile = getattr(ob,pdfName)
@@ -649,7 +656,7 @@
             cvFile.manage_upload(file=data['publications_pdf'])
             
       
-        #REQUEST.response.redirect(self.REQUEST['HTTP_REFERER'])
+        REQUEST.response.redirect("editDownloads");
     
 
     security.declareProtected('View management screens','changeData')
--- a/zpt/staff/edit_downloads.zpt	Thu Jun 20 10:54:14 2013 +0200
+++ b/zpt/staff/edit_downloads.zpt	Thu Jun 20 14:00:13 2013 +0200
@@ -11,7 +11,7 @@
       The documents should be in <b>PDF format</b>. Add the add bottom of this page you find <a href="#templates">templates</a> for
       OpenOffice and Word to make it easier for you to create these documents.
     </p>
-    <form tal:attributes="action string:$root/editDownloads"changeDownloads" method="post" enctype="multipart/form-data">
+    <form tal:attributes="action string:$root/changeDownloads" method="post" enctype="multipart/form-data">
       <h2>Your CV</h2>
       <p>
         <input type="hidden" name="key" tal:attributes="value here/getKey" />
@@ -24,7 +24,7 @@
         <input type="submit" value="Upload the file" />
       </p>
       <p>
-        <a tal:attributes="href $root/downloadCV">Download the CV currently stored at the server.</a> (last update:<span
+        <a tal:attributes="href string:$root/downloadCV">Download the CV currently stored at the server.</a> (last update:<span
           tal:content="here/getLastUpdateCV" />)
       </p>
       <p>
@@ -43,7 +43,7 @@
         <input type="submit" value="Upload the file" />
       </p>
       <p>
-        <a tal:attributes="href $root/downloadPublications">Download the publication list currently stored at the server. </a>(last update:<span
+        <a tal:attributes="href string:$root/downloadPublications">Download the publication list currently stored at the server. </a>(last update:<span
           tal:content="here/getLastUpdatePublications" />)
       </p>
       <p>