Index: openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 21 Feb 2002 20:06:27 -0000 1.11
+++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 22 Feb 2002 19:06:28 -0000 1.12
@@ -31,6 +31,36 @@
+
+
+ select i.item_id as file_id,
+ i.name as name,
+ i.live_revision,
+ r.mime_type as type,
+ to_char(o.last_modified,'YYYY-MM-DD HH24:MI') as last_modified,
+ r.content_length as content_size,
+ 1 as ordering_key
+ from cr_items i left join cr_revisions r on (i.live_revision = r.revision_id), acs_objects o
+ where i.item_id = o.object_id
+ and i.parent_id = :folder_id
+ and acs_permission__permission_p(i.item_id, :user_id, 'read') = 't'
+ and i.content_type = 'file_storage_object'
+ UNION
+ select i.item_id as file_id,
+ f.label as name,
+ 0,
+ 'Folder',
+ NULL,
+ 0,
+ 0
+ from cr_items i, cr_folders f
+ where i.item_id = f.folder_id
+ and i.parent_id = :folder_id
+ and acs_permission__permission_p(f.folder_id, :user_id, 'read') = 't'
+ order by ordering_key,name
+
+
+