Index: openacs-4/packages/download/www/admin/report-one-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user.tcl,v diff -u -r1.6.8.1 -r1.6.8.2 --- openacs-4/packages/download/www/admin/report-one-user.tcl 9 Sep 2013 17:34:17 -0000 1.6.8.1 +++ openacs-4/packages/download/www/admin/report-one-user.tcl 12 Sep 2013 09:57:39 -0000 1.6.8.2 @@ -27,31 +27,46 @@ } -set table_def { - {archive_name "Archive" - {archive_name $order} - {$archive_name}} - {version_name "Version" - {version_name $order} - {$version_name}} - {download_date "Download Date" - {download_date} - {}} - {download_ip "From IP" - {download_ip} - {$download_ip ($download_hostname)}} - {reason "Download Reason" - {reason} - {}} -} +template::list::create -name history_list \ + -multirow history \ + -html { width "90%" align "center"} \ + -elements { + archive_name { + label "Archive" + link_url_col url_archive_id + orderby archive_name + } + version_name { + label "Version" + link_url_col url_archive_id + orderby version_name + } + download_date { + label "Download Date" + orderby download_date + } + download_ip { + label "From IP" + display_template { + @history.download_ip@ (@history.download_hostname@) + } + orderby download_ip + } + reason { + label "Download Reason" + orderby reason + } + } -filters {user_id {} downloaded {}} db_1row name_select { *SQL* } set dimensional_html [ad_dimensional $dimensional] -set table [ad_table \ - -Ttable_extra_html { width="90%" align="center" } \ - -bind [ad_tcl_vars_to_ns_set repository_id user_id] \ - download_table { *SQL* } $table_def ] +db_multirow -extend {url_one_ip url_archive_id} history download_table { *SQL* } { + set url_archive_id [export_vars -base "../one-revision" {revision_id}] + set url_one_ip [export_vars -base "report-one-ip" {download_ip downloaded}] +} + + set context [list [list "report-by-user" "Downloads by User"] "$first_names $last_name"] ad_return_template