Index: openacs-4/packages/acs-templating/tcl/list-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/list-procs.tcl,v diff -u -r1.97 -r1.98 --- openacs-4/packages/acs-templating/tcl/list-procs.tcl 8 Oct 2024 14:20:18 -0000 1.97 +++ openacs-4/packages/acs-templating/tcl/list-procs.tcl 6 Nov 2024 12:18:43 -0000 1.98 @@ -928,11 +928,12 @@ template::list::element::get_reference -list_name $name -element_name $__element_name if {!$element_properties(hide_p)} { lappend __csv_cols $__element_name - lappend __csv_labels [csv_quote $element_properties(label)] + lappend __csv_labels $element_properties(label) } } - append __output "\"[join $__csv_labels "\"$delimiter\""]\"\n" + lappend __output $__csv_labels + set __rowcount [template::multirow size $list_properties(multirow)] set __rownum 0 # Output rows @@ -961,17 +962,21 @@ -element_name $__element_name \ -local_name __element_properties if { [info exists $__element_properties(csv_col)] } { - lappend __cols [csv_quote [set $__element_properties(csv_col)]] + lappend __cols [set $__element_properties(csv_col)] } else { - lappend __cols [csv_quote [set $__element_name]] + lappend __cols [set $__element_name] } } { - lappend __cols [csv_quote [set $__element_name]] + lappend __cols [set $__element_name] } } - append __output "\"[join $__cols "\"$delimiter\""]\"\n" + lappend __output $__cols } } + + package require csv + set __output [::csv::joinlist $__output $delimiter] + set oh [ns_conn outputheaders] ns_set put $oh Content-Disposition "attachment; filename=${__list_name}.csv" ns_return 200 text/csv $__output