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.19.2.2 -r1.19.2.3 --- openacs-4/packages/news/www/item-create-3.tcl 25 Sep 2015 08:25:57 -0000 1.19.2.2 +++ openacs-4/packages/news/www/item-create-3.tcl 11 Aug 2016 12:52:38 -0000 1.19.2.3 @@ -37,8 +37,8 @@ # the news_admin or an open approval policy allow immediate publishing # if { $news_admin_p == 1 || $approval_policy eq "open" } { - set approval_user [ad_conn "user_id"] - set approval_ip [ad_conn "peeraddr"] + set approval_user [ad_conn user_id] + set approval_ip [ad_conn peeraddr] set approval_date [dt_sysdate] set live_revision_p "t" } else { @@ -55,8 +55,8 @@ # get creation_foo set creation_date [dt_sysdate] -set creation_ip [ad_conn "peeraddr"] -set user_id [ad_conn "user_id"] +set creation_ip [ad_conn peeraddr] +set user_id [ad_conn user_id] # avoid any db weirdness with the "." in the variable name. set mime_type ${publish_body.format} @@ -68,7 +68,7 @@ # call. The blob stuff is just needed for Oracle. # set content_add [db_map content_add] -if {![string match $content_add ""]} { +if {$content_add ne ""} { db_dml content_add {} -blobs [list $publish_body] } Index: openacs-4/packages/news/www/item-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/item-create.tcl,v diff -u -r1.14.2.1 -r1.14.2.2 --- openacs-4/packages/news/www/item-create.tcl 12 Sep 2015 11:06:42 -0000 1.14.2.1 +++ openacs-4/packages/news/www/item-create.tcl 11 Aug 2016 12:52:38 -0000 1.14.2.2 @@ -26,7 +26,9 @@ # Furthermore, with news_admin privilege, items are approved immediately # or if open approval policy -if { [permission::permission_p -object_id $package_id -privilege news_admin] || [string equal "open" [parameter::get -parameter ApprovalPolicy -default "open"]] } { +if { [permission::permission_p -object_id $package_id -privilege news_admin] + || [parameter::get -parameter ApprovalPolicy -default "open"] eq "open" + } { set immediate_approve_p 1 } else { set immediate_approve_p 0 @@ -81,8 +83,6 @@ } } -ad_return_template - # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/news/www/preview.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/www/preview.tcl,v diff -u -r1.31.2.2 -r1.31.2.3 --- openacs-4/packages/news/www/preview.tcl 2 Jan 2016 20:34:50 -0000 1.31.2.2 +++ openacs-4/packages/news/www/preview.tcl 11 Aug 2016 12:52:38 -0000 1.31.2.3 @@ -30,7 +30,7 @@ } -validate { check_revision_log -requires {action revision_log} { - if { ![string match $action "News Item"] && $revision_log eq ""} { + if { $action eq "News Item" && $revision_log eq ""} { ad_complain "[_ news.lt_You_must_supply_a_rev]" return } @@ -65,7 +65,7 @@ # Template parser treats publish_body.format as an array reference set publish_format ${publish_body.format} -if { [string match $action "News Item"] } { +if { $action eq "News Item" } { set title "[_ news.Preview_news_item]" } else { set title "[_ news.Preview] $action" @@ -86,7 +86,7 @@ # deal with Dates, granularity is 'day' # with news_admin privilege fill in publish and archive dates -if { $news_admin_p == 1 || [string equal [parameter::get -parameter ApprovalPolicy] "open"] } { +if { $news_admin_p == 1 || [parameter::get -parameter ApprovalPolicy] eq "open" } { if { [info exists publish_date(year)] && [info exists publish_date(month)] && [info exists publish_date(day)] } { set publish_date_ansi "$publish_date(year)-$publish_date(month)-$publish_date(day)" @@ -132,7 +132,7 @@ } } -if { [string match $action "News Item"] } { +if { $action eq "News Item" } { # form variables for confirmation step @@ -141,8 +141,8 @@ set image_vars [export_vars -form {publish_title publish_lead publish_body publish_body.format \ publish_date_ansi archive_date_ansi html_p \ permanent_p action}] - set form_action "
" - set edit_action "" + set form_action "" + set edit_action "" } else { @@ -153,8 +153,8 @@ set image_vars [export_vars -form {publish_title publish_lead publish_body publish_body.format \ publish_date_ansi archive_date_ansi html_p \ permanent_p action item_id revision_log}] - set form_action "" - set edit_action "" + set form_action "" + set edit_action "" } # creator link @@ -163,7 +163,7 @@ from cc_users where user_id = :user_id }] -set creator_link "$creator_name" +set creator_link "[ns_quotehtml $creator_name]" template::head::add_style -style ".news-item-preview { color: inherit; background-color: #eeeeee; margin: 1em 4em 1em 4em; padding: 1em; }" -media screen