Commit 5ed1a09a authored by Jim Fulton's avatar Jim Fulton

Added support for " Add and Edit "...

parent e7786abf
"""Document object""" """Document object"""
__version__='$Revision: 1.62 $'[11:-2] __version__='$Revision: 1.63 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower from string import join,split,strip,rfind,atoi,lower
...@@ -248,7 +248,7 @@ the <!--#var title_and_id--> Folder.</P> ...@@ -248,7 +248,7 @@ the <!--#var title_and_id--> Folder.</P>
manage_addDocumentForm=HTMLFile('documentAdd', globals()) manage_addDocumentForm=HTMLFile('documentAdd', globals())
def manage_addDocument(self,id,title='',file='',REQUEST=None): def manage_addDocument(self, id, title='',file='', REQUEST=None, submit=None):
""" """
Add a Document object with the contents of file. Add a Document object with the contents of file.
...@@ -259,7 +259,10 @@ def manage_addDocument(self,id,title='',file='',REQUEST=None): ...@@ -259,7 +259,10 @@ def manage_addDocument(self,id,title='',file='',REQUEST=None):
i=Document(file, __name__=id) i=Document(file, __name__=id)
i.title=title i.title=title
self._setObject(id,i) self._setObject(id,i)
if REQUEST is not None: return self.manage_main(self,REQUEST) if REQUEST is not None:
u=REQUEST['URL1']
if submit==" Add and Edit ": u="%s/%s" % (u,id)
REQUEST.RESPONSE.redirect(u+'/manage_main')
return '' return ''
class DocumentHandler: class DocumentHandler:
......
...@@ -13,37 +13,26 @@ ...@@ -13,37 +13,26 @@
ENCTYPE="multipart/form-data" TARGET="manage_main"> ENCTYPE="multipart/form-data" TARGET="manage_main">
<TABLE CELLSPACING="2"> <TABLE CELLSPACING="2">
<TR> <TR>
<TD ALIGN="LEFT" VALIGN="TOP"> <TH ALIGN="LEFT" VALIGN="TOP">Id</TH>
<STRONG>Id</STRONG> <TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="id" SIZE="40"></TD>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="id" SIZE="40">
</TD>
</TR> </TR>
<TR> <TR>
<TD ALIGN="LEFT" VALIGN="TOP"> <TH ALIGN="LEFT" VALIGN="TOP"><EM>Title</EM></TH>
<EM><STRONG>Title</STRONG></EM> <TD ALIGN="LEFT" VALIGN="TOP"><INPUT TYPE="TEXT" NAME="title" SIZE="40"></TD>
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="TEXT" NAME="title" SIZE="40">
</TD>
</TR> </TR>
<TR> <TR>
<TH ALIGN="LEFT" VALIGN="TOP"><EM><STRONG>File</STRONG></EM></TD>
<TD ALIGN="LEFT" VALIGN="TOP"> <TD ALIGN="LEFT" VALIGN="TOP">
<EM><STRONG>File</STRONG></EM> <INPUT TYPE="file" NAME="file:string" SIZE="25" VALUE="">
</TD>
<TD ALIGN="LEFT" VALIGN="TOP">
<INPUT TYPE="file" NAME="file:string" SIZE="25" VALUE="">
</TD> </TD>
</TR> </TR>
<TR> <TR><TH></TH>
<TD></TD> <TD>
<TD> <INPUT TYPE="SUBMIT" VALUE=" Add ">
<BR><INPUT TYPE="SUBMIT" VALUE=" Add "> <INPUT TYPE="SUBMIT" VALUE=" Add and Edit " NAME="submit">
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
</FORM> </FORM>
</BODY> </BODY></HTML>
</HTML>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment