maltes
committed
on 23 Jun 06
Removed dependency on acs-data-links
openacs-4/.../mail-tracking/lib/messages.tcl (+5 -17)
238 238     set count 0
239 239     while {[regexp {^(.*?)\t?=\?[^\?]+\?Q\?(.*?)\?=\n?(.*?)$} $subject match before quoted after] && $count < 5} {
240 240         incr count
241 241         set result ""
242 242         for { set i 0 } { $i < [string length $quoted] } { incr i } {
243 243             set current [string index $quoted $i]
244 244             if {$current == "="} {
245 245                 incr i
246 246                 set high [string index $quoted $i]
247 247                 incr i
248 248                 set low [string index $quoted $i]
249 249                 set current [binary format H2 "$high$low"]
250 250             } elseif {[string eq $current "_"]} {
251 251                 set current " "
252 252             }
253 253             append result $current
254 254         }
255 255         set subject "$before$result$after"
256 256     }
257 257
258       set files [list]
259       # We get the related files for all the object_types
260       set content_types [list content_revision content_item file_storage_object image]
261       set files [db_list_of_lists files {}]
262       foreach file_from_list $files {
263           set file_id [lindex $file_from_list 1]
264           if { [string equal [lindex $file_from_list 0] "content_revision"] } {
265               set file [item::get_item_from_revision $file_id]
266           } else {
267               set file $file_id
  258     set files [db_list files {}]
  259     foreach file_id $files {
  260         set title [content::item::get_title -item_id $file_id]
  261         append download_files "<a href=\"[export_vars -base "${tracking_url}download/$title" -url {file_id}]\">$title</a><br>"
268 262     }
269           set title [content::item::get_title -item_id $file]
270           if { [empty_string_p $title] } {
271               set title [acs_object_name $file]
272           }
273           append download_files "<a href=\"[export_vars -base "${tracking_url}download/$title" -url {{file_id $file}}]\">$title</a><br>"
274       }
275 263
276 264     set object_url "/o/$object_id"
277 265 }
278 266
279 267
280 268  
281 269 ad_return_template