daveb
committed
on 19 Jun 10
Fix test which in one part assumed live revision and the rest of the test looked for latest revision. Second pass, all tests pass now.
openacs-4/.../contacts/www/files.tcl (+3 -1)
83 83             }
84 84             set filename [contact::util::generate_filename \
85 85                               -title $title \
86 86                               -extension $extension \
87 87                               -party_id $party_id]
88 88             set revision_id [cr_import_content \
89 89                                  -storage_type "file" -title $title $party_id $tmp_filename $tmp_size $mime_type $filename]
90 90
91 91             content::item::set_live_revision -revision_id $revision_id
92 92
93 93             # if the file is an image we need to create thumbnails
94 94             # #/sw/bin/convert -gravity Center -crop 75x75+0+0 fred.jpg fred.jpg
95 95             # #/sw/bin/convert -gravity Center -geometry 100x100+0+0 04055_7.jpg
96 96             # fred.jpg
97 97
98 98             lappend message "<a href=\"files/$filename\">$title</a>"
99 99         }
100 100         incr upload_number
101 101     }
102 102     if {[llength $message] == 1} {
  103         set message [lindex $message 1]
103 104         util_user_message -html -message "[_ contacts.lt_The_file_lindex_messa]"
104 105     } elseif {[llength $message] > 1} {
  106         set message [join $message ", "]
105 107         util_user_message -html -message "[_ contacts.lt_The_files_join_messag]"
106 108     }
107 109 } -after_submit {
108 110     if {[exists_and_not_null upload_more]} {
109 111         ad_returnredirect [export_vars \
110 112                                -base "files" -url {{upload_count 10}}]
111 113     } else {
112 114         ad_returnredirect "files"
113 115     }
114 116     ad_script_abort
115 117 }
116 118
117 119 template::list::create \
118 120     -html {width 100%} \
119 121     -name "files" \
120 122     -multirow "files" \
121 123     -row_pretty_plural "[_ contacts.files]" \
122 124     -checkbox_name checkbox \
123 125     -bulk_action_export_vars [list party_id orderby] \
124 126     -bulk_actions [list \