Index: openacs-4/packages/download/tcl/download-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/tcl/download-procs.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/download/tcl/download-procs.tcl 15 Sep 2013 21:09:12 -0000 1.14 +++ openacs-4/packages/download/tcl/download-procs.tcl 30 Sep 2013 11:05:49 -0000 1.15 @@ -11,7 +11,7 @@ ad_proc download_repository_info { {package_id ""} {do_redirect 1}} { Get information about the repository mounted for package_id. } { - if [empty_string_p $package_id] { + if {$package_id eq ""} { set package_id [ad_conn package_id] } if { ![db_0or1row repository_info { @@ -135,7 +135,7 @@ regexp "[ad_conn package_url]download/(.*)" [ad_conn url] match path - if [empty_string_p $revision_id] { + if {$revision_id eq ""} { ad_script_abort } @@ -144,7 +144,7 @@ ##Record the download for all time!! set double_click_p [db_string download_count "select count(*) from download_downloads where download_id = :download_id"] if { $double_click_p == 0 } { - if [catch { + if {[catch { db_dml download_insert { insert into download_downloads ( download_id, @@ -167,7 +167,7 @@ :reason_id, :reason_other) } - } errmsg] { + } errmsg]} { ns_log Error "Download: Unable to log download due to an error: $errmsg" } } @@ -217,32 +217,32 @@ order by sort_key } { # date's are complex. convert them first - if { $data_type == "date" } { + if { $data_type eq "date" } { if [catch { set metadata($metadata_id) [validate_ad_dateentrywidget "" metadata.$metadata_id [ns_getform]]} errmsg] { - if {$required_p == "t"} { + if {$required_p eq "t"} { ad_complain "$errmsg: Please make sure your dates are valid." } else { set metadata($metadata_id) "" } } } - if { [exists_and_not_null metadata($metadata_id)] } { + if { ([info exists metadata($metadata_id)] && $metadata($metadata_id) ne "") } { set response_value [string trim $metadata($metadata_id)] - } elseif {$required_p == "t"} { + } elseif {$required_p eq "t"} { lappend metadata_with_missing_responses $pretty_name continue } else { set response_to_question($metadata_id) "" set response_value "" } - if {![empty_string_p $response_value]} { - if { $data_type == "number" } { + if {$response_value ne ""} { + if { $data_type eq "number" } { if { ![regexp {^(-?[0-9]+\.)?[0-9]+$} $response_value] } { ad_complain "The value for \"$metadata\" must be a number. Your value was \"$response_value\"." continue } - } elseif { $data_type == "integer" } { + } elseif { $data_type eq "integer" } { if { ![regexp {^[0-9]+$} $response_value] } { ad_complain "The value for \"$metadata\" must be an integer. Your value was \"$response_value\"." continue @@ -296,7 +296,7 @@ Dummy comment. } { # get the filename part of the upload file - if ![regexp {[^//\\]+$} $upload_file filename] { + if {![regexp {[^//\\]+$} $upload_file filename]} { # no match set filename $upload_file } Index: openacs-4/packages/download/www/archive-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/archive-add-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/download/www/archive-add-2.tcl 12 Sep 2013 10:26:11 -0000 1.4 +++ openacs-4/packages/download/www/archive-add-2.tcl 30 Sep 2013 11:05:49 -0000 1.5 @@ -44,7 +44,7 @@ set archive_desc_id [db_nextval acs_object_id_seq] set revision_id [db_nextval acs_object_id_seq] -if { $html_p == "f" } { +if { $html_p eq "f" } { set description_format "text/plain" } else { set description_format "text/html" Index: openacs-4/packages/download/www/archive-version-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/archive-version-add.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/download/www/archive-version-add.tcl 12 Sep 2013 10:26:11 -0000 1.6 +++ openacs-4/packages/download/www/archive-version-add.tcl 30 Sep 2013 11:05:49 -0000 1.7 @@ -9,7 +9,7 @@ {return_url ""} } -if [empty_string_p $return_url] { +if {$return_url eq ""} { set return_url "[ad_conn package_url]/one-archive?archive_id=$archive_id" } @@ -18,7 +18,7 @@ permission::require_permission -object_id $archive_id -privilege write -if ![db_0or1row archive_info_select { +if {![db_0or1row archive_info_select { select da.archive_name, da.archive_type_id, da.summary, @@ -30,7 +30,7 @@ from download_archives_obj da, cc_users u where da.archive_id = :archive_id and u.user_id = da.creation_user -}] { +}]} { ad_return_complaint 1 "[_ download.lt_The_archive_you_are_l]" return } Index: openacs-4/packages/download/www/download-verify.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/download-verify.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/download/www/download-verify.tcl 12 Sep 2013 10:26:12 -0000 1.9 +++ openacs-4/packages/download/www/download-verify.tcl 30 Sep 2013 11:05:49 -0000 1.10 @@ -20,7 +20,7 @@ set approval "and dar.approved_p = 't'" } -if ![db_0or1row revision_info_select " +if {![db_0or1row revision_info_select " select da.archive_id, da.repository_id as repository_id, da.archive_name, @@ -34,7 +34,7 @@ where da.archive_id = dar.archive_id and dar.revision_id = :revision_id $approval -"] { +"]} { ad_return_complaint 1 "[_ download.lt_The_version_you_are_l]" return } Index: openacs-4/packages/download/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/index.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/download/www/index.tcl 12 Sep 2013 10:53:10 -0000 1.10 +++ openacs-4/packages/download/www/index.tcl 30 Sep 2013 11:05:49 -0000 1.11 @@ -110,7 +110,7 @@ set metadata_select "metadata$metadata_id" append metadata_selects ", (select $answer_column from download_revision_data where revision_id = dar.revision_id and metadata_id = $metadata_id) as $metadata_select " - if { $linked_p == "t" } { + if { $linked_p eq "t" } { set display "@downloads_multirow.$metadata_select@" } else { set display "" Index: openacs-4/packages/download/www/one-archive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/one-archive.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/download/www/one-archive.tcl 12 Sep 2013 10:26:12 -0000 1.9 +++ openacs-4/packages/download/www/one-archive.tcl 30 Sep 2013 11:05:49 -0000 1.10 @@ -15,7 +15,7 @@ set admin_p [permission::permission_p -object_id $archive_id -privilege admin] set write_p [permission::permission_p -object_id $archive_id -privilege write] -if ![db_0or1row archive_info_select { +if {![db_0or1row archive_info_select { select da.archive_name, da.summary, da.description, @@ -26,14 +26,14 @@ from download_archives_obj da, cc_users u where da.archive_id = :archive_id and u.user_id = da.creation_user -}] { +}]} { ad_return_complaint 1 "[_ download.lt_The_archive_you_are_l]" return } -if {[string eq $description_type {text/plain}]} { +if {$description_type eq "text/plain"} { set description [ad_text_to_html -- $description] } @@ -67,8 +67,7 @@ set gc_link [general_comments_create_link -object_name $archive_name $archive_id [ad_conn url]?[ad_conn query]] set gc_comments [general_comments_get_comments $archive_id [ad_conn url]?[ad_conn query]] } error] } { - global errorInfo errorCode - ns_log Notice "gc_link: $errorInfo, $errorCode" + ns_log Notice "gc_link: $::errorInfo, $::errorCode" } Index: openacs-4/packages/download/www/one-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/one-revision.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/download/www/one-revision.tcl 12 Sep 2013 10:26:12 -0000 1.11 +++ openacs-4/packages/download/www/one-revision.tcl 30 Sep 2013 11:05:49 -0000 1.12 @@ -40,7 +40,7 @@ } -if ![db_0or1row revision_info_select " +if {![db_0or1row revision_info_select " select da.archive_id, dat.pretty_name as archive_type, da.archive_type_id, @@ -68,12 +68,12 @@ da.archive_id = dar.archive_id and dar.revision_id = :revision_id and dar.creation_user = u.user_id -"] { +"]} { ad_return_complaint 1 "[_ download.lt_The_revision_you_are_]" return } -if {[string eq $description_type {text/plain}]} { +if {$description_type eq "text/plain"} { set description [ad_text_to_html -- $description] } @@ -84,8 +84,7 @@ set gc_link [general_comments_create_link -object_name "$archive_name $version_name" $revision_id [ad_conn url]?[ad_conn query]] set gc_comments [general_comments_get_comments $revision_id [ad_conn url]?[ad_conn query]] } error] } { - global errorInfo errorCode - ns_log Notice "gc_link: $errorInfo, $errorCode" + ns_log Notice "gc_link: $::errorInfo, $::errorCode" } ad_return_template Index: openacs-4/packages/download/www/admin/approve-or-reject-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/approve-or-reject-2.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/download/www/admin/approve-or-reject-2.tcl 18 Sep 2013 15:23:40 -0000 1.7 +++ openacs-4/packages/download/www/admin/approve-or-reject-2.tcl 30 Sep 2013 11:05:49 -0000 1.8 @@ -11,7 +11,7 @@ {return_url "[ad_conn package_url]"} } -validate { valid_action_value { - if { $action != "approve" && $action != "reject" } { + if { $action ne "approve" && $action ne "reject" } { ad_complain "The value for 'action' must be 'approve' or 'reject'" } } @@ -24,7 +24,7 @@ permission::require_permission -object_id $repository_id -privilege "admin" -if { $action == "approve" } { +if { $action eq "approve" } { set approved_p "t" set approval_action "approving" set approval_status "APPROVED" @@ -35,7 +35,7 @@ } # Here's where we update the database to set the version as approved -if [catch { +if {[catch { db_dml version_approve " update download_archive_revisions set approved_p = :approved_p, @@ -44,7 +44,7 @@ approved_date = sysdate where revision_id = :revision_id " -} errmsg] { +} errmsg]} { ad_return_error "Problem $approval_action version" "There was a problem $approval_action the version in the database. Here's the error message: $errmsg" return Index: openacs-4/packages/download/www/admin/approve-or-reject.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/approve-or-reject.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/download/www/admin/approve-or-reject.tcl 10 Sep 2002 22:22:35 -0000 1.5 +++ openacs-4/packages/download/www/admin/approve-or-reject.tcl 30 Sep 2013 11:05:50 -0000 1.6 @@ -10,15 +10,15 @@ {return_url "[ad_conn package_url]"} } -validate { valid_action_value { - if { $action != "approve" && $action != "reject" } { + if { $action ne "approve" && $action ne "reject" } { ad_complain "The value for 'action' must be 'approve' or 'reject'" } } } set package_id [ad_conn package_id] -if ![db_0or1row revision_info_select { +if {![db_0or1row revision_info_select { select da.repository_id as repository_id, da.archive_id, da.archive_name, @@ -37,12 +37,12 @@ where da.archive_id = dar.archive_id and dar.revision_id = :revision_id and u.user_id = dar.creation_user -}] { +}]} { ad_return_complaint 1 "The version id $revision_id was not found" return } -if { $action == "approve" } { +if { $action eq "approve" } { set pretty_action "Approve" set pretty_noun "Approval" } else { Index: openacs-4/packages/download/www/admin/repository-metadata-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/repository-metadata-edit.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/download/www/admin/repository-metadata-edit.tcl 12 Sep 2013 10:26:13 -0000 1.5 +++ openacs-4/packages/download/www/admin/repository-metadata-edit.tcl 30 Sep 2013 11:05:50 -0000 1.6 @@ -81,7 +81,7 @@ delete from download_metadata_choices where metadata_id = :metadata_id } - if { $data_type == "choice" } { + if { $data_type eq "choice" } { set choices [split $choices ","] set count 0 foreach choice $choices { Index: openacs-4/packages/download/www/admin/repository-metadata.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/repository-metadata.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/download/www/admin/repository-metadata.tcl 10 Sep 2002 22:22:35 -0000 1.3 +++ openacs-4/packages/download/www/admin/repository-metadata.tcl 30 Sep 2013 11:05:50 -0000 1.4 @@ -58,7 +58,7 @@ :computed_p) } - if { $data_type == "choice" } { + if { $data_type eq "choice" } { set choices [split $choices ","] set count 0 foreach choice $choices { Index: openacs-4/packages/download/www/admin/spam-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/download/www/admin/spam-users.tcl 12 Sep 2013 10:26:13 -0000 1.6 +++ openacs-4/packages/download/www/admin/spam-users.tcl 30 Sep 2013 11:05:50 -0000 1.7 @@ -24,7 +24,7 @@ db_multirow users user_select { *SQL* } { lappend want_spam_list $user_id } -set no_spam_count [expr [llength user_id_list] - [llength want_spam_list]] +set no_spam_count [expr {[llength user_id_list] - [llength want_spam_list]}] set user_id_list $want_spam_list set user_id_list_export [export_vars -form -sign {user_id_list}]