Index: openacs-4/packages/bookmarks/www/index-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/index-postgresql.xql,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/bookmarks/www/index-postgresql.xql 17 May 2004 15:14:58 -0000 1.11
+++ openacs-4/packages/bookmarks/www/index-postgresql.xql 6 Jul 2016 08:35:03 -0000 1.12
@@ -35,39 +35,28 @@
u.complete_url, u.last_live_date, u.last_checked_date,
b.folder_p,
bm_in_closed_p.closed_p,
- coalesce(admin_view.object_id, 0) as admin_p,
- coalesce(delete_view.object_id,0) as delete_p,
+ acs_permission__permission_p(b.bookmark_id, :browsing_user_id, 'admin') as admin_p,
+ acs_permission__permission_p(b.bookmark_id, :browsing_user_id, 'delete') as delete_p,
b.lev as indentation
$private_select
from
bm_in_closed_p cross join
- ((( bm_urls u right join (
- select $index_order bm.bookmark_id, bm.url_id, bm.local_title, bm.folder_p,
- tree_level(bm.tree_sortkey) as lev, bm.parent_id, bm.tree_sortkey
- from bm_bookmarks bm, bm_bookmarks bm2
- where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey)
- and bm2.bookmark_id = :root_folder_id
- ) b on (u.url_id=b.url_id)) left join (
- select distinct object_id
- from all_object_party_privilege_map
- where party_id = :browsing_user_id and privilege = 'admin'
- ) admin_view on (admin_view.object_id=b.bookmark_id)) left join (
- select distinct object_id
- from all_object_party_privilege_map
- where party_id = :browsing_user_id and privilege = 'delete'
- ) delete_view on (delete_view.object_id = b.bookmark_id))
- where bm_in_closed_p.bookmark_id = b.bookmark_id
+ (bm_urls u right join (
+ select $index_order bm.bookmark_id, bm.url_id, bm.local_title, bm.folder_p,
+ tree_level(bm.tree_sortkey) as lev, bm.parent_id, bm.tree_sortkey
+ from bm_bookmarks bm, bm_bookmarks bm2
+ where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey)
+ and bm2.bookmark_id = :root_folder_id
+ ) b on (u.url_id = b.url_id) )
+ where bm_in_closed_p.bookmark_id = b.bookmark_id
and bm_in_closed_p.in_closed_p = 'f'
and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
and exists (select 1
from bm_bookmarks bm, bm_bookmarks bm2
- where exists (select 1
- from all_object_party_privilege_map
- where object_id = bm.bookmark_id
- and party_id = :browsing_user_id
- and privilege = 'read')
- and bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey)
- and bm2.bookmark_id = b.bookmark_id)
+ where bm.tree_sortkey between bm2.tree_sortkey and tree_right(bm2.tree_sortkey)
+ and bm2.bookmark_id = b.bookmark_id
+ and acs_permission__permission_p(bm.bookmark_id, :browsing_user_id, 'read')
+ )
and b.bookmark_id <> :root_folder_id
order by b.tree_sortkey
Index: openacs-4/packages/bookmarks/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/index.adp,v
diff -u -r1.20 -r1.21
--- openacs-4/packages/bookmarks/www/index.adp 30 Jul 2015 10:43:05 -0000 1.20
+++ openacs-4/packages/bookmarks/www/index.adp 6 Jul 2016 08:35:03 -0000 1.21
@@ -51,7 +51,7 @@
append decoration_close ""
}
- if {@bookmark.folder_p@ == "t"} {
+ if {@bookmark.folder_p@ true} {
append decoration_open ""
append decoration_close ""
}
@@ -60,18 +60,18 @@
set action_bar ""
- if { "@bookmark.admin_p@" ne "0" } {
+ if { "@bookmark.admin_p@" true } {
lappend action_bar [subst {
$edit_anchor
}]
}
- if { "@bookmark.delete_p@" ne "0" } {
+ if { "@bookmark.delete_p@" true } {
lappend action_bar [subst {
$delete_anchor
}]
}
- if {@bookmark.folder_p@ == "f"} {
+ if {@bookmark.folder_p@ false} {
set url "bookmark-access?bookmark_id=@bookmark.bookmark_id;literal@&url=[ad_urlencode @bookmark.complete_url;literal@]"
set bgcolor $bookmark_bgcolor
set image_url "pics/ftv2doc.gif"
@@ -83,9 +83,9 @@
set url "toggle-open-close?bookmark_id=@bookmark.bookmark_id;literal@&viewed_user_id=@viewed_user_id;literal@&sort_by=@sort_by@&browsing_user_id=@browsing_user_id;literal@"
# different image_urls for whether or not the folder is open
- if {@bookmark.closed_p@ == "t"} {
+ if {@bookmark.closed_p@ true} {
set image_url "pics/ftv2folderclosed.gif"
- } elseif {@bookmark.closed_p@ == "f" } {
+ } elseif {@bookmark.closed_p@ false } {
set image_url "pics/ftv2folderopen.gif"
}
}
Index: openacs-4/packages/bookmarks/www/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/bookmarks/www/index.tcl,v
diff -u -r1.15 -r1.16
--- openacs-4/packages/bookmarks/www/index.tcl 27 Jun 2015 17:39:23 -0000 1.15
+++ openacs-4/packages/bookmarks/www/index.tcl 6 Jul 2016 08:35:03 -0000 1.16
@@ -116,37 +116,7 @@
} else {
set private_select ", 'f' as private_p"
- db_multirow bookmark bookmarks_select "select b.bookmark_id,
-b.url_id,
-b.local_title as bookmark_title,
-u.complete_url,
-u.last_live_date,
-u.last_checked_date,
-b.folder_p,
-bm_in_closed_p.closed_p,
-nvl(admin_view.object_id, 0) as admin_p,
-nvl(delete_view.object_id,0) as delete_p,
-b.lev as indentation
-$private_select
-
-from bm_urls u,
-(select $index_order bookmark_id, url_id, local_title, folder_p, level lev, parent_id, rownum ord_num
-from bm_bookmarks start with bookmark_id = :root_folder_id connect by prior bookmark_id = parent_id) b,
-bm_in_closed_p,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'admin') admin_view,
-(select object_id from acs_object_party_privilege_map
- where party_id in (:browsing_user_id, -1) and privilege = 'delete') delete_view
-where b.url_id = u.url_id (+)
-and bm_in_closed_p.bookmark_id = b.bookmark_id
-and bm_in_closed_p.in_closed_p = 'f'
-and bm_in_closed_p.in_closed_p_id = :in_closed_p_id
-and exists (select 1 from bm_bookmarks where exists (select 1 from acs_object_party_privilege_map where object_id = bookmark_id and party_id in (:browsing_user_id, -1) and privilege = 'read') start with bookmark_id = b.bookmark_id connect by prior bookmark_id = parent_id)
-and b.bookmark_id <> :root_folder_id
-and b.bookmark_id = admin_view.object_id(+)
-and b.bookmark_id = delete_view.object_id(+)
-order by ord_num"
-
+ db_multirow bookmark bookmarks_select {}
}
set tree_url [export_vars -base tree { viewed_user_id write_p user_name }]