Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs-oracle.xql,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql 20 Mar 2003 22:11:36 -0000 1.1.2.1
+++ openacs-4/packages/acs-content-repository/tcl/extlink-procs-oracle.xql 27 May 2003 17:52:28 -0000 1.1.2.2
@@ -48,7 +48,8 @@
- select content_extlink.is_extlink (item => :item_id);
+ select content_extlink.is_extlink (:item_id)
+ from dual
Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs.tcl,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl 20 Mar 2003 22:11:36 -0000 1.1.2.1
+++ openacs-4/packages/acs-content-repository/tcl/extlink-procs.tcl 27 May 2003 17:52:28 -0000 1.1.2.2
@@ -87,3 +87,15 @@
} {
return [db_string extlink_check {}]
}
+
+ad_proc content_extlink::extlink_name {
+ -item_id:required
+} {
+
+ Returns the name of an extlink
+
+ @item_id The object id of the item to check.
+
+} {
+ return [db_string extlink_name {}]
+}
Index: openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/Attic/extlink-procs.xql,v
diff -u -r1.1.2.1 -r1.1.2.2
--- openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql 20 Mar 2003 22:11:36 -0000 1.1.2.1
+++ openacs-4/packages/acs-content-repository/tcl/extlink-procs.xql 27 May 2003 17:52:28 -0000 1.1.2.2
@@ -13,4 +13,12 @@
+
+
+ select label
+ from cr_extlinks
+ where extlink_id = :item_id
+
+
+
Index: openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/Attic/attachments-procs-oracle.xql,v
diff -u -r1.2.2.1 -r1.2.2.2
--- openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql 26 May 2003 21:38:58 -0000 1.2.2.1
+++ openacs-4/packages/attachments/tcl/attachments-procs-oracle.xql 27 May 2003 17:53:06 -0000 1.2.2.2
@@ -4,19 +4,16 @@
- select a.item_id,
- e.label
- from attachments a, cr_extlinks e
+ select item_id
+ from attachments
where object_id = :object_id
- and a.item_id = e.extlink_id
- and a.approved_p = 't'
+ and approved_p = 't'
select item_id,
- acs_object.name(item_id),
approved_p
from attachments
where object_id = :object_id
Index: openacs-4/packages/attachments/tcl/attachments-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/tcl/attachments-procs.tcl,v
diff -u -r1.9 -r1.9.2.1
--- openacs-4/packages/attachments/tcl/attachments-procs.tcl 10 Sep 2002 22:22:21 -0000 1.9
+++ openacs-4/packages/attachments/tcl/attachments-procs.tcl 27 May 2003 17:53:06 -0000 1.9.2.1
@@ -144,9 +144,14 @@
set lst [db_list_of_lists select_attachments {}]
set lst_with_urls [list]
- foreach el $lst {
- set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]]
- lappend lst_with_urls [concat $el $append_lst]
+ foreach item_id $lst {
+ if { [content_extlink::extlink_p -item_id $item_id] } {
+ set label [content_extlink::extlink_name -item_id $item_id]
+ } else {
+ set label [fs::get_object_name -object_id $item_id]
+ }
+ set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]]
+ lappend lst_with_urls [concat [list $item_id $label] $append_lst]
}
return $lst_with_urls
@@ -161,9 +166,14 @@
set lst [db_list_of_lists select_attachments {}]
set lst_with_urls [list]
- foreach el $lst {
- set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id [lindex $el 0] -base_url $base_url]]
- lappend lst_with_urls [concat $el $append_lst]
+ foreach item_id $lst {
+ if { [content_extlink::extlink_p -item_id $item_id] } {
+ set label [content_extlink::extlink_name -item_id $item_id]
+ } else {
+ set label [fs::get_object_name -object_id $item_id]
+ }
+ set append_lst [list [goto_attachment_url -object_id $object_id -attachment_id $item_id -base_url $base_url]]
+ lappend lst_with_urls [concat [list $item_id $label] $append_lst]
}
return $lst_with_urls
Index: openacs-4/packages/attachments/www/go-to-attachment.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/go-to-attachment.tcl,v
diff -u -r1.2.2.3 -r1.2.2.4
--- openacs-4/packages/attachments/www/go-to-attachment.tcl 26 May 2003 21:39:13 -0000 1.2.2.3
+++ openacs-4/packages/attachments/www/go-to-attachment.tcl 27 May 2003 17:53:24 -0000 1.2.2.4
@@ -25,15 +25,15 @@
return
}
- content_item {
+ file_storage_object {
set title [db_string select_attachment_title {}]
ad_returnredirect "download/[ad_urlencode $title]?object_id=$object_id&attachment_id=$attachment_id"
ad_script_abort
return
}
default {
- ad_return_complaint 1 "don't know how to deal with this attachment type"
+ ad_return_complaint 1 "don't know how to deal with attachment type $content_type"
return
}
}