Code

. users may attach files to issues (and support in ext) through the web now
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 14 Nov 2001 21:35:22 +0000 (21:35 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 14 Nov 2001 21:35:22 +0000 (21:35 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@401 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi_client.py
roundup/templatebuilder.py
roundup/templates/classic/html/issue.item
roundup/templates/classic/htmlbase.py
roundup/templates/extended/html/issue.item
roundup/templates/extended/html/support.item
roundup/templates/extended/htmlbase.py

index 2df05e5a6b46e32bd62894267f5d0af1e542088e..413f268a8dac41cd8aa23bad96730cd338b02f08 100644 (file)
@@ -12,6 +12,7 @@ Feature:
  . roundup-admin now accepts abbreviated commands (eg. l = li = lis = list)
  . roundup-mailgw now supports unix mailbox and POP as sources of mail.
  . roundup-admin now handles all hyperdb exceptions
+ . users may attach files to issues (and support in ext) through the web now
 
 Fixed:
  . Fixed a bug in HTMLTemplate changes.
index 43b648e85cf70746552d98ee706e83ca8715d370..e05aa1a8468dc08215f48c7682ff85b45ec2bbaa 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: cgi_client.py,v 1.55 2001-11-07 02:34:06 jhermann Exp $
+# $Id: cgi_client.py,v 1.56 2001-11-14 21:35:21 richard Exp $
 
 import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
 import binascii, Cookie, time
@@ -424,6 +424,17 @@ class Client:
                     link = self.db.classes[link]
                     link.set(nodeid, **{property: nid})
 
+        # handle file attachments
+        files = []
+        if self.form.has_key('__file'):
+            file = self.form['__file']
+            type = mimetypes.guess_type(file.filename)[0]
+            if not type:
+                type = "application/octet-stream"
+            # create the new file entry
+            files.append(self.db.file.create(type=type, name=file.filename,
+                content=file.file.read()))
+
         # generate an edit message
         # don't bother if there's no messages or nosy list 
         props = cl.getprops()
@@ -481,7 +492,7 @@ class Client:
                 content=content)
             messages = cl.get(nid, 'messages')
             messages.append(message_id)
-            props = {'messages': messages}
+            props = {'messages': messages, 'files': files}
             cl.set(nid, **props)
 
     def newnode(self, message=None):
@@ -955,6 +966,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.55  2001/11/07 02:34:06  jhermann
+# Handling of damaged login cookies
+#
 # Revision 1.54  2001/11/07 01:16:12  richard
 # Remove the '=' padding from cookie value so quoting isn't an issue.
 #
index a4c29125f5d2b892801dbe0f33a4199311ca1638..cbbd0bf8a98da3168990a1c96b808e1c51d0c422 100644 (file)
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: templatebuilder.py,v 1.11 2001-08-07 00:24:42 richard Exp $
+# $Id: templatebuilder.py,v 1.12 2001-11-14 21:35:21 richard Exp $
 import errno, re
 
 preamble = """ 
@@ -81,10 +81,13 @@ if __name__ == "__main__":
     elif len(sys.argv) == 3:
         installHtmlBase(sys.argv[1], sys.argv[2])
     else:
-        raise "what you talkin about willis?"
+        print "Usage: %s <template directory>"%sys.argv[0]
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.11  2001/08/07 00:24:42  richard
+# stupid typo
+#
 # Revision 1.10  2001/08/07 00:15:51  richard
 # Added the copyright/license notice to (nearly) all files at request of
 # Bizar Software.
index f0f7c671b08f456c0714963ea09d2d95b62ed554..c0de8fdf2bf6b6cd648f406c82232709feb09ce3 100644 (file)
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>
index 45ba1ac1f165bf83b933a56d349d52c1fcfc1e63..efc14eeb6d3281740b6c44062ce503bd9cb2a1ae 100644 (file)
@@ -119,6 +119,11 @@ issueDOTitem = """<!-- dollarId: issue.item,v 1.4 2001/08/03 01:19:43 richard Ex
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>
index e2fd7ff842ddc10331e3cc32345d79f1f71cc5d3..7c7573a784b91261747ce0260efee8c2c8afa07c 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: issue.item,v 1.5 2001-07-30 08:03:56 richard Exp $-->
+<!-- $Id: issue.item,v 1.6 2001-11-14 21:35:22 richard Exp $-->
 <table border=0 cellspacing=0 cellpadding=2>
 
 <tr class="strong-header">
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>
index b6c1d7abf2c84074e0bab88fdd30a9369f24e235..478e9093e08b143623a3b0c4e724427e8d6da3d0 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: support.item,v 1.2 2001-07-30 08:03:56 richard Exp $-->
+<!-- $Id: support.item,v 1.3 2001-11-14 21:35:22 richard Exp $-->
 <table border=0 cellspacing=0 cellpadding=2>
 
 <tr class="strong-header">
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>
index ca32455f7c546b4e1d26471fa74321cfadc89e9f..8cd83b26a78b77a527447b7efdb7a9d6db17272b 100644 (file)
@@ -156,6 +156,11 @@ issueDOTitem = """<!-- dollarId: issue.item,v 1.5 2001/07/30 08:03:56 richard Ex
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>
@@ -537,6 +542,11 @@ supportDOTitem = """<!-- dollarId: support.item,v 1.2 2001/07/30 08:03:56 richar
     <td colspan=3 class="form-text"><display call="note()"></td>
 </tr>
 
+<tr bgcolor="ffffea">
+    <td width=1% nowrap align=right><span class="form-label">File</span></td>
+    <td colspan=3 class="form-text"><input type="file" name="__file" size="80"></td>
+</tr>
+
 <tr bgcolor="ffffea">
     <td>&nbsp;</td>
     <td colspan=3 class="form-text"><display call="submit()"></td>