select count(*)
Index: openacs-4/packages/file-storage/www/folder-chunk-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-chunk-oracle.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/file-storage/www/folder-chunk-oracle.xql 18 Nov 2002 18:01:05 -0000 1.2
+++ openacs-4/packages/file-storage/www/folder-chunk-oracle.xql 18 Feb 2003 20:56:09 -0000 1.3
@@ -4,20 +4,40 @@
oracle8.1.6
- 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 >= (sysdate - :n_past_days) then 1 else 0 end as new_p
- from fs_objects
- where fs_objects.parent_id = :folder_id
- order by sort_key, name
+
+ 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,
+ fs_objects.content_size,
+ fs_objects.url,
+ fs_objects.sort_key,
+ fs_objects.file_upload_name,
+ case when fs_objects.last_modified >= (sysdate - :n_past_days) then 1 else 0 end as new_p,
+ case
+ when type = 'url'
+ then acs_permission.permission_p(fs_objects.object_id, :viewing_user_id, 'delete')
+ else 't'
+ end as delete_p,
+ case
+ when type = 'url'
+ then acs_permission.permission_p(fs_objects.object_id, :viewing_user_id, 'write')
+ else 't'
+ end 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 = :viewing_user_id
+ and m.privilege = 'read')
+ order by fs_objects.sort_key, fs_objects.name
+
-
\ No newline at end of file
+
+
+
+
+
Index: openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 21 Dec 2002 22:28:31 -0000 1.3
+++ openacs-4/packages/file-storage/www/folder-chunk-postgresql.xql 18 Feb 2003 20:56:09 -0000 1.4
@@ -4,20 +4,81 @@
postgresql7.1
- 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,
- 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
- from fs_objects
- where fs_objects.parent_id = :folder_id
- order by sort_key, name
+
+ 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,
+ fs_objects.content_size,
+ fs_objects.url,
+ 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,
+ delete_p,
+ write_p
+ from
+ (select fs_folders.folder_id as object_id,
+ 0 as live_revision,
+ 'folder' as type,
+ fs_folders.content_size,
+ fs_folders.name,
+ '' as file_upload_name,
+ fs_folders.last_modified,
+ '' as url,
+ fs_folders.parent_id,
+ cast('f' as bool) as write_p,
+ cast('f' as bool) as delete_p,
+ 0 as sort_key
+ from fs_folders
+ where fs_folders.parent_id = :folder_id
+ and exists (select 1
+ from acs_object_party_privilege_map m
+ where m.object_id = fs_folders.folder_id
+ and m.party_id = :viewing_user_id
+ and m.privilege = 'read')
+ union all
+ select fs_files.file_id as object_id,
+ fs_files.live_revision,
+ fs_files.type,
+ fs_files.content_size,
+ fs_files.name,
+ fs_files.file_upload_name,
+ fs_files.last_modified,
+ '' as url,
+ fs_files.parent_id,
+ cast('f' as bool) as write_p,
+ cast('f' as bool) as delete_p,
+ 1 as sort_key
+ from fs_files
+ where fs_files.parent_id = :folder_id
+ and exists (select 1
+ from acs_object_party_privilege_map m
+ where m.object_id = fs_files.file_id
+ and m.party_id = :viewing_user_id
+ and m.privilege = 'read')
+ union all
+ select fs_urls_full.url_id as object_id,
+ 0 as live_revision,
+ 'url' as type,
+ 0 as content_size,
+ fs_urls_full.name,
+ fs_urls_full.name as file_upload_name,
+ fs_urls_full.last_modified,
+ fs_urls_full.url,
+ fs_urls_full.folder_id as parent_id,
+ acs_permission__permission_p(fs_urls.url_id, :viewing_user_id, 'write') as write_p,
+ acs_permission__permission_p(fs_urls.url_id, :viewing_user_id, 'delete') as delete_p,
+ 1 as sort_key
+ from fs_urls_full
+ where fs_urls_full.folder_id = :folder_id
+ and exists (select 1
+ from acs_object_party_privilege_map m
+ where m.object_id = fs_urls_full.url_id
+ and m.party_id = :viewing_user_id
+ and m.privilege = 'read')) as fs_objects
+ order by fs_objects.sort_key, fs_objects.name
+
Index: openacs-4/packages/file-storage/www/folder-chunk.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.adp,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/file-storage/www/folder-chunk.adp 16 Jan 2003 13:47:56 -0000 1.15
+++ openacs-4/packages/file-storage/www/folder-chunk.adp 18 Feb 2003 20:56:09 -0000 1.16
@@ -23,7 +23,7 @@
|
- @contents.content_size_pretty@ #file-storage.items##file-storage.item#
+ @contents.content_size@ #file-storage.items##file-storage.item#
|
#file-storage.folder# |
@contents.last_modified@ |
@@ -37,18 +37,18 @@
-
+
[
#file-storage.edit#
-
+
|
#file-storage.delete#
-
+
]
@@ -74,7 +74,7 @@
]
|
- @contents.content_size_pretty@ bytes |
+ @contents.content_size@ bytes |
@contents.type@ |
@contents.last_modified@ |
Index: openacs-4/packages/file-storage/www/folder-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/file-storage/www/folder-chunk.tcl 18 Nov 2002 18:01:05 -0000 1.10
+++ openacs-4/packages/file-storage/www/folder-chunk.tcl 18 Feb 2003 20:56:09 -0000 1.11
@@ -29,13 +29,12 @@
set fs_url ""
}
+db_multirow contents select_folder_contents {} {
+ set file_upload_name [fs::remove_special_file_system_characters -string $file_upload_name]
+ set last_modified [lc_time_fmt $last_modified "%x %X"]
+ set content_size [lc_numeric $content_size]
+}
+
set folder_name [fs::get_object_name -object_id $folder_id]
-set rows [fs::get_folder_contents \
- -folder_id $folder_id \
- -user_id $viewing_user_id \
- -n_past_days $n_past_days \
-]
-util::list_of_ns_sets_to_multirow -rows $rows -var_name "contents"
-
ad_return_template