Index: openacs-4/packages/invoices/www/invoice-ae.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-ae.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/invoices/www/invoice-ae.adp 16 Aug 2005 20:04:34 -0000 1.1 +++ openacs-4/packages/invoices/www/invoice-ae.adp 1 Nov 2006 14:27:56 -0000 1.2 @@ -5,4 +5,6 @@
- + +invoice.odt + Index: openacs-4/packages/invoices/www/invoice-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-ae.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/invoices/www/invoice-ae.tcl 27 Oct 2006 17:09:11 -0000 1.41 +++ openacs-4/packages/invoices/www/invoice-ae.tcl 1 Nov 2006 14:27:56 -0000 1.42 @@ -733,4 +733,10 @@ ad_script_abort } +if {[acs_user::site_wide_admin_p]} { + set odt_url [export_vars -base "invoice-documents" {invoice_id {invoice_p 1} {odt_p 1}}] +} else { + set odt_url "" +} + ad_return_template Index: openacs-4/packages/invoices/www/invoice-documents.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice-documents.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/invoices/www/invoice-documents.tcl 27 Oct 2006 17:08:23 -0000 1.3 +++ openacs-4/packages/invoices/www/invoice-documents.tcl 1 Nov 2006 14:27:56 -0000 1.4 @@ -8,6 +8,7 @@ {opening_p 0} {invoice_p 1} {copy_p 0} + {odt_p 0} {file_ids ""} {return_url:optional ""} {display_p 1} @@ -65,6 +66,13 @@ # (opening, invoice/credit/cancellation, copy) set documents [iv::invoice::parse_data -invoice_id $invoice_id -types $document_types -email_text ""] +# We want to get the odt file only +if {$odt_p} { + set file [lindex $documents 1] + ad_returnredirect [export_vars -base "invoice.odt" -url {file}] + ad_script_abort +} + multirow create documents file_id file_title file_url set files {} set documents [lreplace $documents 0 0] Index: openacs-4/packages/invoices/www/invoice.odt.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/invoices/www/invoice.odt.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/invoices/www/invoice.odt.tcl 1 Nov 2006 14:27:56 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + Page to return the file with an .odt name at the end + + @author Timo Hentschel (timo@timohentschel.de) + @creation-date 2005-06-21 +} { + {file} +} + +ns_returnfile 200 application/odt $file \ No newline at end of file