Index: openacs-4/packages/general-comments/general-comments.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/general-comments.info,v diff -u -r1.11.2.3 -r1.11.2.4 --- openacs-4/packages/general-comments/general-comments.info 13 Oct 2004 15:12:22 -0000 1.11.2.3 +++ openacs-4/packages/general-comments/general-comments.info 29 Nov 2004 20:04:17 -0000 1.11.2.4 @@ -8,25 +8,28 @@ t comments - + Don Baccus + Dave Bauer Service to provide comment entry and display on objects. - 2003-01-30 + 2004-11-29 OpenACS General comments provides the widgets and UI to support commentability on any object. There is also an admin interface to edit/hide/delete comments. - + + + Index: openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql,v diff -u -r1.4.4.1 -r1.4.4.2 --- openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 22 Mar 2004 02:54:57 -0000 1.4.4.1 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-oracle.xql 29 Nov 2004 20:04:17 -0000 1.4.4.2 @@ -21,7 +21,8 @@ r.revision_id = content_item.get_live_revision(g.comment_id) and o.object_id = g.comment_id $context_clause - order by o.creation_date + $my_comments_clause + order by $orderby Index: openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql,v diff -u -r1.4.4.1 -r1.4.4.2 --- openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 22 Mar 2004 02:54:57 -0000 1.4.4.1 +++ openacs-4/packages/general-comments/tcl/general-comments-procs-postgresql.xql 29 Nov 2004 20:04:17 -0000 1.4.4.2 @@ -21,7 +21,8 @@ r.revision_id = content_item__get_live_revision(g.comment_id) and o.object_id = g.comment_id $context_clause - order by o.creation_date + $my_comments_clause + order by $orderby Index: openacs-4/packages/general-comments/tcl/general-comments-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/general-comments/tcl/general-comments-procs.tcl,v diff -u -r1.12.2.2 -r1.12.2.3 --- openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 21 Jun 2004 18:46:47 -0000 1.12.2.2 +++ openacs-4/packages/general-comments/tcl/general-comments-procs.tcl 29 Nov 2004 20:04:17 -0000 1.12.2.3 @@ -81,7 +81,8 @@ ad_proc -public general_comments_get_comments { { -print_content_p 0 } { -print_attachments_p 0 } - {-context_id ""} + { -context_id "" } + { -my_comments_only_p 0 } object_id {return_url {}} } { @@ -101,6 +102,35 @@ return "" } + # package_id + array set node_array [site_node::get -url $package_url] + set package_id $node_array(package_id) + + # set ordering + set recent_on_top_p [parameter::get \ + -package_id $package_id \ + -parameter "RecentOnTopP" \ + -default f] + + if {[string is true $recent_on_top_p]} { + set orderby "o.creation_date desc" + } else { + set orderby "o.creation_date" + } + + # filter output to only see present user? + set allow_my_comments_only_p [parameter::get \ + -package_id $package_id \ + -parameter "AllowDisplayMyCommentsLinkP" \ + -default t] + + if {[string is true $my_comments_only_p] && \ + [string is true $allow_my_comments_only_p]} { + set my_comments_clause "and o.creation_user = :user_id" + } else { + set my_comments_clause "" + } + # initialize variables if { $print_content_p == 0 } { set content_select ""