Index: openacs-4/packages/forums/lib/forums-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums-portlet.tcl,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/forums/lib/forums-portlet.tcl 20 Sep 2008 12:10:28 -0000 1.3 +++ openacs-4/packages/forums/lib/forums-portlet.tcl 30 Sep 2013 11:33:53 -0000 1.3.4.1 @@ -15,8 +15,8 @@ } # validate args -if { ![exists_and_not_null package_id] - && ![exists_and_not_null base_url] } { +if { (![info exists package_id] || $package_id eq "") + && (![info exists base_url] || $base_url eq "") } { error "package_id and/or base_url must be given" } if { [info exists n] } { @@ -31,11 +31,11 @@ if { ![info exists cache] || [expr {$cache < 0}] } { set cache 0 } -if { ![exists_and_not_null package_id] } { +if { (![info exists package_id] || $package_id eq "") } { set package_id [site_node::get_element \ -url $base_url -element object_id] } -if { ![exists_and_not_null base_url] } { +if { (![info exists base_url] || $base_url eq "") } { set base_url [lindex [site_node::get_url_from_object_id \ -object_id $package_id] 0] } Index: openacs-4/packages/forums/lib/forums/admin-forums-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/admin-forums-chunk.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/forums/lib/forums/admin-forums-chunk.tcl 25 Nov 2011 19:16:11 -0000 1.4 +++ openacs-4/packages/forums/lib/forums/admin-forums-chunk.tcl 30 Sep 2013 11:33:53 -0000 1.4.2.1 @@ -69,6 +69,6 @@ set disable_url [export_vars -base "forum-disable" { forum_id }] } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/forums/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/edit.tcl,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/forums/lib/forums/edit.tcl 27 Apr 2009 19:36:21 -0000 1.3 +++ openacs-4/packages/forums/lib/forums/edit.tcl 30 Sep 2013 11:33:53 -0000 1.3.4.1 @@ -52,6 +52,6 @@ element set_properties forum new_threads_p -value [forum::new_questions_allowed_p -forum_id $forum(forum_id)] } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/forums/forums-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/forums-chunk.tcl,v diff -u -r1.13 -r1.13.4.1 --- openacs-4/packages/forums/lib/forums/forums-chunk.tcl 27 Apr 2009 16:31:19 -0000 1.13 +++ openacs-4/packages/forums/lib/forums/forums-chunk.tcl 30 Sep 2013 11:33:53 -0000 1.13.4.1 @@ -99,6 +99,6 @@ set statistic "[_ forums.Statistics]" } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/forums/forums-history-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/forums-history-chunk.tcl,v diff -u -r1.4 -r1.4.6.1 --- openacs-4/packages/forums/lib/forums/forums-history-chunk.tcl 22 May 2007 09:42:08 -0000 1.4 +++ openacs-4/packages/forums/lib/forums/forums-history-chunk.tcl 30 Sep 2013 11:33:53 -0000 1.4.6.1 @@ -2,7 +2,7 @@ Forums History - @author Natalia P�rez (nperper@it.uc3m.es) + @author Natalia Pérez (nperper@it.uc3m.es) @creation-date 2005-03-17 } @@ -43,6 +43,6 @@ db_multirow persons select_users_wrote_post {} -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/forums/new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/forums/new.tcl,v diff -u -r1.5 -r1.5.4.1 --- openacs-4/packages/forums/lib/forums/new.tcl 27 Apr 2009 19:36:21 -0000 1.5 +++ openacs-4/packages/forums/lib/forums/new.tcl 30 Sep 2013 11:33:54 -0000 1.5.4.1 @@ -58,6 +58,6 @@ element set_value forum name $name } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/attachment-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/attachment-list.tcl,v diff -u -r1.3 -r1.3.4.1 --- openacs-4/packages/forums/lib/message/attachment-list.tcl 9 Nov 2008 23:29:26 -0000 1.3 +++ openacs-4/packages/forums/lib/message/attachment-list.tcl 30 Sep 2013 11:33:54 -0000 1.3.4.1 @@ -10,7 +10,7 @@ ad_return_complaint 1 "[_ forums.lt_need_to_provide_a_mes]" } -if {![exists_and_not_null bgcolor]} { +if {(![info exists bgcolor] || $bgcolor eq "")} { set bgcolor "#ffffff" } @@ -24,6 +24,6 @@ set attachment_graphic [attachments::graphic_url] -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/delete.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/forums/lib/message/delete.tcl 4 Jan 2008 17:27:47 -0000 1.3 +++ openacs-4/packages/forums/lib/message/delete.tcl 30 Sep 2013 11:33:54 -0000 1.3.6.1 @@ -26,6 +26,6 @@ set confirm_url [export_vars -base "message-delete" {message_id return_url {confirm_p 1}}] -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/messages-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/messages-table.tcl,v diff -u -r1.3 -r1.3.6.1 --- openacs-4/packages/forums/lib/message/messages-table.tcl 23 Dec 2007 14:50:15 -0000 1.3 +++ openacs-4/packages/forums/lib/message/messages-table.tcl 30 Sep 2013 11:33:54 -0000 1.3.6.1 @@ -28,6 +28,6 @@ } } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/pending-list-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/pending-list-chunk.tcl,v diff -u -r1.1 -r1.1.16.1 --- openacs-4/packages/forums/lib/message/pending-list-chunk.tcl 17 Dec 2003 15:45:29 -0000 1.1 +++ openacs-4/packages/forums/lib/message/pending-list-chunk.tcl 30 Sep 2013 11:33:54 -0000 1.1.16.1 @@ -11,6 +11,6 @@ # Get the threads that need approval db_multirow pending_threads select_pending_threads {} -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/post.tcl,v diff -u -r1.21 -r1.21.4.1 --- openacs-4/packages/forums/lib/message/post.tcl 29 May 2009 12:32:50 -0000 1.21 +++ openacs-4/packages/forums/lib/message/post.tcl 30 Sep 2013 11:33:54 -0000 1.21.4.1 @@ -221,6 +221,6 @@ } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/row.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/row.tcl,v diff -u -r1.11 -r1.11.4.1 --- openacs-4/packages/forums/lib/message/row.tcl 9 Nov 2008 22:25:20 -0000 1.11 +++ openacs-4/packages/forums/lib/message/row.tcl 30 Sep 2013 11:33:54 -0000 1.11.4.1 @@ -13,11 +13,11 @@ set useScreenNameP [parameter::get -parameter "UseScreenNameP" -default 0] set screen_name [db_string select_screen_name { select screen_name from users where user_id = :viewer_id}] -if {![exists_and_not_null rownum]} { +if {(![info exists rownum] || $rownum eq "")} { set rownum 1 } -if {![exists_and_not_null presentation_type]} { +if {(![info exists presentation_type] || $presentation_type eq "")} { set presentation_type "" } @@ -37,7 +37,7 @@ set display_subject_p [expr {$subject ne $root_subject }] } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } if {![info exists message(message_id)]} { Index: openacs-4/packages/forums/lib/message/row2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/row2.tcl,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/forums/lib/message/row2.tcl 20 Sep 2008 12:10:28 -0000 1.2 +++ openacs-4/packages/forums/lib/message/row2.tcl 30 Sep 2013 11:33:54 -0000 1.2.4.1 @@ -13,7 +13,7 @@ set viewer_id [ad_conn user_id] -if {![exists_and_not_null rownum]} { +if {(![info exists rownum] || $rownum eq "")} { set rownum 1 } @@ -30,7 +30,7 @@ set display_subject_p [expr {$subject ne $root_subject }] } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } if {![info exists message(message_id)]} { Index: openacs-4/packages/forums/lib/message/thread-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/thread-chunk.tcl,v diff -u -r1.11 -r1.11.4.1 --- openacs-4/packages/forums/lib/message/thread-chunk.tcl 9 Nov 2008 23:29:26 -0000 1.11 +++ openacs-4/packages/forums/lib/message/thread-chunk.tcl 30 Sep 2013 11:33:54 -0000 1.11.4.1 @@ -59,7 +59,7 @@ set message(number) [expr {[lsearch $message_id_list $message(message_id)] + 1}] set message(parent_number) {} set message(parent_direct_url) "" -if { [exists_and_not_null message(parent_id)] } { +if { [info exists message(parent_id)] && $message(parent_id) ne "" } { set message(parent_number) [expr {[lsearch $message_id_list $message(parent_id)] + 1}] set message(parent_direct_url) "$direct_url_base\#msg_$message(parent_id)" set message(parent_root_url) [export_vars -base [ad_conn url] { { message_id $message(parent_id) } }] @@ -131,7 +131,7 @@ set message(tree_level) 0 -if {[exists_and_not_null alt_template]} { +if {[info exists alt_template] && $alt_template ne ""} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/message/threads-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/threads-chunk.tcl,v diff -u -r1.14.4.1 -r1.14.4.2 --- openacs-4/packages/forums/lib/message/threads-chunk.tcl 7 Sep 2013 14:36:50 -0000 1.14.4.1 +++ openacs-4/packages/forums/lib/message/threads-chunk.tcl 30 Sep 2013 11:33:54 -0000 1.14.4.2 @@ -33,11 +33,11 @@ set actions [list] -if {![exists_and_not_null page_size]} { +if {![info exists page_size] || $page_size eq ""} { set page_size 30 } -if {![exists_and_not_null base_url]} { +if {![info exists base_url] || $base_url eq ""} { set base_url "" } @@ -47,22 +47,31 @@ # moderated 2. User is a moderator or adminsitrator if {$permissions(post_p)} { - if {([forum::new_questions_allowed_p -forum_id $forum_id] && ($forum(posting_policy) eq "open" || $forum(posting_policy) eq "moderated")) || [template::util::is_true $permissions(admin_p)] || [template::util::is_true $permissions(moderate_p)] } { - lappend actions [_ forums.Post_a_New_Message] [export_vars -base "${base_url}message-post" { forum_id }] [_ forums.Post_a_New_Message] + if {( + [forum::new_questions_allowed_p -forum_id $forum_id] + && ($forum(posting_policy) eq "open" || $forum(posting_policy) eq "moderated") + ) + || [template::util::is_true $permissions(admin_p)] + || [template::util::is_true $permissions(moderate_p)] + } { + lappend actions [_ forums.Post_a_New_Message] \ + [export_vars -base "${base_url}message-post" { forum_id }] [_ forums.Post_a_New_Message] } } if { [template::util::is_true $permissions(admin_p)] } { - lappend actions [_ forums.Administer] [export_vars \ - -base "${base_url}admin/forum-edit" {forum_id {return_url [ad_return_url]}}] [_ forums.Administer] + lappend actions [_ forums.Administer] \ + [export_vars -base "${base_url}admin/forum-edit" {forum_id {return_url [ad_return_url]}}] [_ forums.Administer] } if { [template::util::is_true $permissions(moderate_p)] } { - lappend actions [_ forums.ManageModerate] [export_vars -base "${base_url}moderate/forum" { forum_id }] [_ forums.ManageModerate] + lappend actions [_ forums.ManageModerate] \ + [export_vars -base "${base_url}moderate/forum" { forum_id }] [_ forums.ManageModerate] } if { $useReadingInfo } { - lappend actions [_ forums.mark_all_as_read] [export_vars -base "${base_url}mark-all-read" { forum_id }] {} + lappend actions [_ forums.mark_all_as_read] \ + [export_vars -base "${base_url}mark-all-read" { forum_id }] {} } template::list::create \ @@ -184,6 +193,6 @@ } } -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/lib/search/search-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/search/search-chunk.tcl,v diff -u -r1.6 -r1.6.4.1 --- openacs-4/packages/forums/lib/search/search-chunk.tcl 20 Sep 2008 12:10:28 -0000 1.6 +++ openacs-4/packages/forums/lib/search/search-chunk.tcl 30 Sep 2013 11:33:54 -0000 1.6.4.1 @@ -41,7 +41,7 @@ set messages:rowcount 0 } - if {[exists_and_not_null alt_template]} { + if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } } Index: openacs-4/packages/forums/lib/user/post-history-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/user/post-history-chunk.tcl,v diff -u -r1.7 -r1.7.2.1 --- openacs-4/packages/forums/lib/user/post-history-chunk.tcl 25 Nov 2011 19:16:11 -0000 1.7 +++ openacs-4/packages/forums/lib/user/post-history-chunk.tcl 30 Sep 2013 11:33:54 -0000 1.7.2.1 @@ -116,6 +116,6 @@ set dimensional_chunk [ad_dimensional $dimensional_list] -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/www/moderate/move-thread-thread.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/move-thread-thread.tcl,v diff -u -r1.3.4.1 -r1.3.4.2 --- openacs-4/packages/forums/www/moderate/move-thread-thread.tcl 9 Sep 2013 16:44:27 -0000 1.3.4.1 +++ openacs-4/packages/forums/www/moderate/move-thread-thread.tcl 30 Sep 2013 11:33:55 -0000 1.3.4.2 @@ -86,6 +86,6 @@ } set url_vars [export_vars -url {msg_id return_url selected_message}] -if {[exists_and_not_null alt_template]} { +if {([info exists alt_template] && $alt_template ne "")} { ad_return_template $alt_template } Index: openacs-4/packages/forums/www/moderate/move-thread.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/move-thread.tcl,v diff -u -r1.4.4.1 -r1.4.4.2 --- openacs-4/packages/forums/www/moderate/move-thread.tcl 9 Sep 2013 16:44:27 -0000 1.4.4.1 +++ openacs-4/packages/forums/www/moderate/move-thread.tcl 30 Sep 2013 11:33:55 -0000 1.4.4.2 @@ -20,7 +20,10 @@ forum::message::get -message_id $msg_id -array message #form to confirm -ad_form -name confirmed_move -mode {display} -actions [list [list [_ forums.Yes] yes] [list No no] ] -export { msg_id return_url selected_message} -html {enctype multipart/form-data} -form { +ad_form -name confirmed_move -mode {display} \ + -actions [list [list [_ forums.Yes] yes] [list No no] ] \ + -export { msg_id return_url selected_message} \ + -html {enctype multipart/form-data} -form { {data:text(hidden) {value 0}} } #get the clicked button @@ -91,7 +94,7 @@ set url_vars [export_vars -url {msg_id return_url selected_message}] -if {[exists_and_not_null alt_template]} { +if {[info exists alt_template] && $alt_template ne ""} { ad_return_template $alt_template } Index: openacs-4/packages/forums/www/moderate/move.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/move.tcl,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/forums/www/moderate/move.tcl 9 Sep 2013 16:44:27 -0000 1.3.2.1 +++ openacs-4/packages/forums/www/moderate/move.tcl 30 Sep 2013 11:33:55 -0000 1.3.2.2 @@ -20,7 +20,10 @@ forum::message::get -message_id $message_id -array message #form to confirm if a user want to move the thread -ad_form -name confirmed_move -mode {display} -actions [list [list [_ forums.Yes] yes] [list No no] ] -export { message_id return_url selected_forum} -html {enctype multipart/form-data} -form { +ad_form -name confirmed_move -mode {display} \ + -actions [list [list [_ forums.Yes] yes] [list No no] ] \ + -export { message_id return_url selected_forum} \ + -html {enctype multipart/form-data} -form { {data:text(hidden) {value 0}} } #get the clicked button @@ -85,6 +88,6 @@ } set url_vars [export_vars -url {message_id return_url selected_forum}] -if {[exists_and_not_null alt_template]} { +if {[info exists alt_template] && $alt_template ne ""} { ad_return_template $alt_template }