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.32 -r1.33 --- openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 21 Jan 2003 13:10:59 -0000 1.32 +++ openacs-4/packages/file-storage/tcl/file-storage-procs-postgresql.xql 17 May 2003 10:39:21 -0000 1.33 @@ -44,30 +44,30 @@ --- we use $ n_past-days instead of :n_past_days because the pgdriver --- bind variable emulation puts single-quotes around the n_past_days --- integer. Postgresql tries to turn '-1' into a date datatype --- so now()-'-1' fails but now()- interval '-1' works fine. - select fc.* - from (select fs_objects.object_id, - fs_objects.name, - fs_objects.live_revision, - fs_objects.type, - to_char(fs_objects.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified_ansi, - fs_objects.content_size, - fs_objects.url, - fs_objects.key, - fs_objects.sort_key, - fs_objects.file_upload_name, - case when fs_objects.last_modified >= (now() - interval '$n_past_days days') then 1 else 0 end as new_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p, - acs_permission__permission_p(fs_objects.object_id, :user_id, 'write') as write_p - from fs_objects - where fs_objects.parent_id = :folder_id) fc - where 't' = (select acs_permission__permission_p(fc.object_id, :user_id, 'read') from dual) - order by fc.sort_key, - fc.name + + select fs_objects.object_id, + fs_objects.name, + fs_objects.live_revision, + fs_objects.type, + to_char(fs_objects.last_modified, 'Month DD YYYY HH24:MI') as last_modified, + fs_objects.content_size, + fs_objects.url, + fs_objects.key, + fs_objects.sort_key, + fs_objects.file_upload_name, + case when fs_objects.last_modified >= (now() - interval '$n_past_days days') then 1 else 0 end as new_p, + acs_permission__permission_p(fs_objects.object_id, :user_id, 'admin') as admin_p, + acs_permission__permission_p(fs_objects.object_id, :user_id, 'delete') as delete_p, + acs_permission__permission_p(fs_objects.object_id, :user_id, 'write') as write_p + from fs_objects + where fs_objects.parent_id = :folder_id + and exists (select 1 + from acs_object_party_privilege_map m + where m.object_id = fs_objects.object_id + and m.party_id = :user_id + and m.privilege = 'read') + order by fs_objects.sort_key, fs_objects.name + @@ -81,7 +81,7 @@ select count(*) from cr_items c1, cr_items c2 - where c2.item_id = file_storage__get_parent_id(:item_id) + where c2.item_id = :item_id and c1.tree_sortkey between c2.tree_sortkey and tree_right(c2.tree_sortkey) and not acs_permission__permission_p(c1.item_id, :user_id, :privilege) @@ -128,4 +128,12 @@ + + + select lob + from cr_revisions + where revision_id = $live_revision + + +