Index: openacs-4/packages/news/lib/item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/lib/item.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news/lib/item.tcl 6 Sep 2013 17:06:05 -0000 1.2 +++ openacs-4/packages/news/lib/item.tcl 30 Sep 2013 10:51:35 -0000 1.3 @@ -56,14 +56,14 @@ # RAL: publish_body is already snagged in the 1st query above for postgres. # set get_content [db_map get_content] - if {![string match "" $get_content]} { + if {$get_content ne ""} { set publish_body [db_string get_content "select content from cr_revisions where revision_id = :live_revision"] } # text-only body - if {[info exists html_p] && [string equal $html_p "f"]} { + if {[info exists html_p] && $html_p eq "f"} { set publish_body [ad_text_to_html -- $publish_body] } @@ -86,7 +86,7 @@ # get image info, if any set image_id [news_get_image_id $item_id] - if {![empty_string_p $image_id]} { + if {$image_id ne ""} { set publish_image "image/$image_id" } else { set publish_image {} Index: openacs-4/packages/news/lib/latest-news.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/lib/latest-news.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news/lib/latest-news.tcl 5 Feb 2005 11:55:09 -0000 1.2 +++ openacs-4/packages/news/lib/latest-news.tcl 30 Sep 2013 10:51:35 -0000 1.3 @@ -32,16 +32,16 @@ foreach param {id class} { if { ![info exists $param] } { set $param {} } } if { ![info exists show_empty_p] } { set show_empty_p 1 } -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 "must supply package_id and/or base_url" } -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/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/news/tcl/news-procs.tcl 2 Feb 2010 18:57:30 -0000 1.33 +++ openacs-4/packages/news/tcl/news-procs.tcl 30 Sep 2013 10:51:35 -0000 1.34 @@ -108,7 +108,7 @@ set url_stub [news_util_get_url $package_id] set url "[ad_url]${url_stub}item/$item_id" - if {[empty_string_p $publish_lead]} { + if {$publish_lead eq ""} { set publish_lead $publish_body } @@ -174,7 +174,7 @@ set now_seconds [clock scan now] set n_days_until_archive {} - if { ![empty_string_p $archive_date] } { + if { $archive_date ne "" } { set archive_date_seconds [clock scan $archive_date] if { $archive_date_seconds > $now_seconds } { @@ -183,7 +183,7 @@ } } - if { ![empty_string_p $publish_date] } { + if { $publish_date ne "" } { # The item has been published or is scheduled to be published set publish_date_seconds [clock scan $publish_date] Index: openacs-4/packages/news/tcl/test/news-db-test-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/test/news-db-test-init.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/news/tcl/test/news-db-test-init.tcl 6 Sep 2013 16:46:28 -0000 1.10 +++ openacs-4/packages/news/tcl/test/news-db-test-init.tcl 30 Sep 2013 10:51:35 -0000 1.11 @@ -45,7 +45,7 @@ switch [string trim $url] { "/_test/news/" { set _news_node_id $node_id - if {$object_id != ""} { + if {$object_id ne ""} { set _news_package_id $object_id } } @@ -163,7 +163,7 @@ aa_export_vars {p_full_details p_title p_text p_package_id p_is_live p_approval_user p_approval_ip p_approval_date p_archive_date news_id} - if {$p_full_details == "t"} { + if {$p_full_details eq "t"} { set p_approval_user [ad_conn "user_id"] set p_approval_ip [ad_conn "peeraddr"] set p_approval_date [dt_sysdate] @@ -227,7 +227,7 @@ p_description p_approval_user p_approval_ip p_approval_date p_archive_date revision_id} - if {$p_full_details == "t"} { + if {$p_full_details eq "t"} { set p_approval_user [ad_conn "user_id"] set p_approval_ip [ad_conn "peeraddr"] set p_approval_date [dt_sysdate] @@ -312,7 +312,7 @@ p_approval_user p_approval_date p_approval_ip p_live_revision_p} - if {$p_approve_p == "f"} { + if {$p_approve_p eq "f"} { db_exec_plsql set-approve-default { begin content_item.set_approve-default(revision_id => :p_revision_id, @@ -470,7 +470,7 @@ p_archive_date
} { aa_export_vars {p_item_id p_archive_date} - if {$p_archive_date == ""} { + if {$p_archive_date eq ""} { db_exec_plsql archive-default { begin news.archive(:p_item_id, null); @@ -769,11 +769,11 @@ } else { aa_equals "Check package_id correct" $package_id $_news_package_id aa_equals "Check archive_date correct" \ - [string range $archive_date 0 [expr [string length $p_archive_date]-1]] \ + [string range $archive_date 0 [string length $p_archive_date]-1] \ $p_archive_date aa_equals "Check approval_user correct" $approval_user $p_approval_user aa_equals "Check approval_date correct" \ - [string range $approval_date 0 [expr [string length $p_approval_date] - 1]] \ + [string range $approval_date 0 [string length $p_approval_date]-1] \ $p_approval_date aa_equals "Check approval_ip correct" $approval_ip $p_approval_ip } @@ -934,11 +934,11 @@ aa_log "Check the cr_news fields for the second revision" aa_equals "Check package_id correct" $package_id $_news_package_id aa_equals "Check archive_date correct" \ - [string range $archive_date 0 [expr [string length $p_archive_date]-1]] \ + [string range $archive_date 0 [string length $p_archive_date]-1] \ $p_archive_date aa_equals "Check approval_user correct" $approval_user $p_approval_user aa_equals "Check approval_date correct" \ - [string range $approval_date 0 [expr [string length $p_approval_date] - 1]] \ + [string range $approval_date 0 [string length $p_approval_date]-1] \ $p_approval_date aa_equals "Check approval_ip correct" $approval_ip $p_approval_ip @@ -1074,7 +1074,7 @@ set p_news_id $news_id aa_call_component db-get-cr-news-row aa_equals "Check the explicitly set archive_date is $p_archive_date" \ - [string range $archive_date 0 [expr [string length $p_archive_date] - 1]] \ + [string range $archive_date 0 [string length $p_archive_date]-1] \ $p_archive_date # @@ -1096,7 +1096,7 @@ aa_true "Check the cr_news row was found" $retrieval_ok_p set todays_date [clock format [clock seconds] -format "%Y-%m-%d"] aa_equals "Check the explicitly set archive_date is $todays_date" \ - [string range $archive_date 0 [expr [string length $todays_date] - 1]] \ + [string range $archive_date 0 [string length $todays_date]-1] \ $todays_date } } { @@ -1227,16 +1227,16 @@ aa_error "cr_news row not found for new revision news_id $revision1_id" } else { aa_equals "Check the archive_date is correct" \ - [string range $archive_date 0 [expr [string length $p_archive_date]-1]] \ + [string range $archive_date 0 [string length $p_archive_date]-1] \ $p_archive_date aa_equals "Check the approval_date is correct" \ - [string range $approval_date 0 [expr [string length $p_approval_date]-1]] \ + [string range $approval_date 0 [string length $p_approval_date]-1] \ $p_approval_date aa_equals "Check the aprroval_user is correct" \ - [string range $approval_user 0 [expr [string length $p_approval_user]-1]] \ + [string range $approval_user 0 [string length $p_approval_user]-1] \ $p_approval_user aa_equals "Check the approval_ip is correct" \ - [string range $approval_ip 0 [expr [string length $p_approval_ip]-1]] \ + [string range $approval_ip 0 [string length $p_approval_ip]-1] \ $p_approval_ip } @@ -1249,7 +1249,7 @@ aa_error "cr_revisions row not found for new revision revision_id $revision1_id" } else { aa_equals "Check revision 1 publish_date is null" \ - [string range $publish_date 0 [expr [string length $p_publish_date]-1]] \ + [string range $publish_date 0 [string length $p_publish_date]-1] \ $p_publish_date } } Index: openacs-4/packages/news/tcl/test/news-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/test/news-test-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news/tcl/test/news-test-procs.tcl 6 Oct 2003 12:11:23 -0000 1.2 +++ openacs-4/packages/news/tcl/test/news-test-procs.tcl 30 Sep 2013 10:51:35 -0000 1.3 @@ -17,11 +17,11 @@ @author Peter Marklund } { set now_seconds [clock scan now] - set offset [expr 60*60*24*10] + set offset [expr {60*60*24*10}] set date_format "%Y-%m-%d" - set future_seconds [expr $now_seconds + $offset] + set future_seconds [expr {$now_seconds + $offset}] set future_date [clock format $future_seconds -format $date_format] - set past_seconds [expr $now_seconds - $offset] + set past_seconds [expr {$now_seconds - $offset}] set past_date [clock format $past_seconds -format $date_format] # Scheduled for publish, no archive @@ -68,7 +68,7 @@ } { set pretty_status [news_pretty_status -publish_date $publish_date -archive_date $archive_date -status $status] aa_true "publish_date=\"$publish_date\" archive_date=\"$archive_date\" status=\"$status\" pretty_status=\"$pretty_status\"" \ - [expr ![empty_string_p $pretty_status]] + [expr {$pretty_status ne ""}] set db_news_status [news::test::get_news_status \ -publish_date $publish_date \ Index: openacs-4/packages/news/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/index.tcl,v diff -u -r1.18 -r1.19 --- openacs-4/packages/news/www/index.tcl 6 Sep 2013 17:06:05 -0000 1.18 +++ openacs-4/packages/news/www/index.tcl 30 Sep 2013 10:51:35 -0000 1.19 @@ -33,7 +33,7 @@ set actions_list [list] # view switch in live | archived news -if { [string equal "live" $view] } { +if {"live" eq $view} { set title [apm_instance_name_from_id $package_id] set view_clause [db_map view_clause_live] Index: openacs-4/packages/news/www/item-create-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item-create-3.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/news/www/item-create-3.tcl 6 Sep 2013 17:06:05 -0000 1.16 +++ openacs-4/packages/news/www/item-create-3.tcl 30 Sep 2013 10:51:35 -0000 1.17 @@ -34,7 +34,7 @@ set approval_policy [parameter::get -parameter ApprovalPolicy -default "wait"] # the news_admin or an open approval policy allow immediate publishing -if { $news_admin_p == 1 || [string equal $approval_policy "open"] } { +if { $news_admin_p == 1 || $approval_policy eq "open" } { set approval_user [ad_conn "user_id"] set approval_ip [ad_conn "peeraddr"] @@ -52,7 +52,7 @@ # RAL: This was missing and allows the user to "never expire" a news # item. -if {[string equal $permanent_p "t"] } { +if {$permanent_p eq "t"} { set archive_date_ansi [db_null] } @@ -81,7 +81,7 @@ if { !$news_admin_p } { - if { ![string equal "open" [parameter::get -parameter ApprovalPolicy -default "wait"]] } { + if { "open" ne [parameter::get -parameter ApprovalPolicy -default "wait"] } { # case: user submitted news item, is returned to a Thank-you page set title "[_ news.News_item_submitted]" set context [list $title] Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/news/www/preview.tcl 9 Sep 2013 17:34:18 -0000 1.29 +++ openacs-4/packages/news/www/preview.tcl 30 Sep 2013 10:51:35 -0000 1.30 @@ -30,7 +30,7 @@ } -validate { check_revision_log -requires {action revision_log} { - if { ![string match $action "News Item"] && [empty_string_p $revision_log]} { + if { ![string match $action "News Item"] && $revision_log eq ""} { ad_complain "[_ news.lt_You_must_supply_a_rev]" return } @@ -126,7 +126,7 @@ # the check will need to be added as a validator for each ad_form call. set errors [ad_html_security_check $publish_body] - if { ![empty_string_p $errors] } { + if { $errors ne "" } { ad_return_complaint 1 $errors ad_script_abort } Index: openacs-4/packages/news/www/admin/approve-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/approve-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/www/admin/approve-2.tcl 24 Feb 2005 13:33:23 -0000 1.4 +++ openacs-4/packages/news/www/admin/approve-2.tcl 30 Sep 2013 10:51:35 -0000 1.5 @@ -23,7 +23,7 @@ set publish_date_ansi $publish_date(date) -if {[string equal $permanent_p "t"]} { +if {$permanent_p eq "t"} { set archive_date_ansi [db_null] Index: openacs-4/packages/news/www/admin/approve.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/approve.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/news/www/admin/approve.tcl 9 Sep 2013 17:34:18 -0000 1.6 +++ openacs-4/packages/news/www/admin/approve.tcl 30 Sep 2013 10:51:35 -0000 1.7 @@ -41,7 +41,7 @@ # get most likely revision_id if not supplied -if {[empty_string_p $revision_id]} { +if {$revision_id eq ""} { set revision_select [db_map revision_select] } else { set revision_select "'$revision_id' as revision_id," Index: openacs-4/packages/news/www/admin/process.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/process.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/news/www/admin/process.tcl 9 Sep 2013 17:34:18 -0000 1.9 +++ openacs-4/packages/news/www/admin/process.tcl 30 Sep 2013 10:51:35 -0000 1.10 @@ -28,7 +28,7 @@ # in the case of (Re-)Publish, redirect to approve -if {[string equal "publish" $action]} { +if {"publish" eq $action} { ad_returnredirect "approve?[export_vars -url {n_items}]" ad_script_abort Index: openacs-4/packages/news/www/admin/revision-add-3.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/admin/revision-add-3.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/news/www/admin/revision-add-3.tcl 26 Dec 2009 23:50:53 -0000 1.10 +++ openacs-4/packages/news/www/admin/revision-add-3.tcl 30 Sep 2013 10:51:35 -0000 1.11 @@ -24,7 +24,7 @@ # Avoid any driver/bindvar nonsense regarding "." in a variable name set mime_type ${publish_body.format} -if {[string equal $permanent_p "t"] } { +if {$permanent_p eq "t"} { set archive_date_ansi [db_null] }