Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -N -r1.48.4.3 -r1.48.4.4 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 10 Oct 2013 21:20:10 -0000 1.48.4.3 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 13 Oct 2013 10:03:24 -0000 1.48.4.4 @@ -218,37 +218,35 @@ seconds { return [lindex $date 5] } format { return [lindex $date 6] } long_month_name { - if {[lindex $date 1] eq {}} { + if {[lindex $date 1] eq ""} { return {} } else { return [monthName [lindex $date 1] long] } } short_month_name { - if {[lindex $date 1] eq {}} { + if {[lindex $date 1] eq ""} { return {} } else { return [monthName [lindex $date 1] short] } } days_in_month { - if { [string equal [lindex $date 1] {}] || \ - [string equal [lindex $date 0] {}]} { + if { [lindex $date 1] eq "" || [lindex $date 0] eq "" } { return 31 } else { - return [daysInMonth \ - [lindex $date 1] [lindex $date 0]] + return [daysInMonth [lindex $date 1] [lindex $date 0]] } } short_year { - if {[lindex $date 0] eq {}} { + if {[lindex $date 0] eq ""} { return {} } else { return [expr {[lindex $date 0] % 100}] } } short_hours { - if {[lindex $date 3] eq {}} { + if {[lindex $date 3] eq ""} { return {} } else { set value [expr {[lindex $date 3] % 12}] @@ -260,7 +258,7 @@ } } ampm { - if {[lindex $date 3] eq {}} { + if {[lindex $date 3] eq ""} { return {} } else { if { [lindex $date 3] > 11 } { @@ -303,7 +301,7 @@ # DEDS: revert this first as to_timestamp is only for # oracle9i. no clear announcement that openacs has dropped # support for 8i - if { [llength $date] <= 3 || ([string equal [db_type] "oracle"] && [string match "8.*" [db_version]]) } { + if { [llength $date] <= 3 || ([db_type] eq "oracle" && [string match "8.*" [db_version]]) } { return "to_date('$value', '$format')" } else { return "to_timestamp('$value', '$format')" @@ -371,8 +369,7 @@ } set value [lc_time_fmt [join $date_list "-"] "%q"] unpack $date - if { $hours ne {} && \ - $minutes ne {} } { + if { $hours ne "" && $minutes ne "" } { append value " [string range $pad [string length $hours] end]${hours}:[string range $pad [string length $minutes] end]$minutes" if { $seconds ne {} } { append value ":[string range $pad [string length $seconds] end]$seconds" @@ -384,15 +381,12 @@ set value "" # Unreliable ! unpack $date - if { $year ne {} && \ - $month ne {} && \ - $day ne {} } { + if { $year ne "" && $month ne "" && $day ne "" } { append value "$month/$day/$year" } - if { $hours ne {} && \ - $minutes ne {} } { + if { $hours ne "" && $minutes ne "" } { append value " ${hours}:${minutes}" - if { $seconds ne {} } { + if { $seconds ne "" } { append value ":$seconds" } } @@ -466,7 +460,7 @@ return [lreplace $date 3 3 $value] } ampm { - if {[lindex $date 3] eq {}} { + if {[lindex $date 3] eq ""} { return $date } else { set hours [lindex $date 3] @@ -702,7 +696,7 @@ Check if a value is less than zero, but return false if the value is an empty string } { - if {$value eq {}} { + if {$value eq ""} { return 0 } else { return [expr {[template::util::leadingTrim $value] < 0}] @@ -731,7 +725,7 @@ hours "HH24|HH12" minutes "MI" seconds "SS" } { # If the field is required, but missing, report an error - if {[set $field] eq {}} { + if {[set $field] eq ""} { if { [regexp $exp $format match] } { set field_pretty [_ acs-templating.${field}] lappend error_msg [_ acs-templating.lt_No_value_supplied_for_-field_pretty-] @@ -795,8 +789,8 @@ Pad a string with leading zeroes } { - if {$string eq {}} { - return {} + if {$string eq ""} { + return "" } set ret [string repeat "0" [expr {$size - [string length $string]}]] @@ -809,9 +803,9 @@ Trim the leading zeroes from the value, but preserve the value as "0" if it is "00" } { - set empty [string equal $value {}] + set empty [string equal $value ""] set value [string trimleft $value 0] - if { !$empty && $value eq {} } { + if { !$empty && $value eq "" } { set value 0 } return $value @@ -882,13 +876,14 @@ set interval $element(${fragment}_interval) } else { # Display text entry for some elements, or if the type is text - if { $type == "t" || - [regexp "year|short_year" $fragment] } { + if { $type == "t" + || [regexp "year|short_year" $fragment] + } { set output "\n" # Prepare the value to set defaults on the form - if { [info exists element(value)] && - [template::util::date::get_property not_null $element(value)] } { + if { [info exists element(value)] + && [template::util::date::get_property not_null $element(value)] + } { set value $element(value) foreach v $value { lappend trim_value [template::util::leadingTrim $v] @@ -1153,7 +1149,9 @@ set format [string tolower $format] # this format key must now be at max five characters, and contain one y, one m and one d # as well as two punction marks ( - . / ) - if { [regexp {^([y|m|d])([\-|\.|/])([y|m|d])([\-|\.|/])([y|m|d])} $format match first first_punct second second_punct third] && [string length $format] eq "5" } { + if { [regexp {^([y|m|d])([\-|\.|/])([y|m|d])([\-|\.|/])([y|m|d])} $format match first first_punct second second_punct third] + && [string length $format] == "5" + } { if { [lsort [list $first $second $third]] eq "d m y" } { # we have a valid format from acs-lang.localization-d_fmt with all 3 necessary elements # and only two valid punctuation marks Index: openacs-4/packages/acs-templating/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/element-procs.tcl,v diff -u -N -r1.32.2.5 -r1.32.2.6 --- openacs-4/packages/acs-templating/tcl/element-procs.tcl 5 Oct 2013 12:55:09 -0000 1.32.2.5 +++ openacs-4/packages/acs-templating/tcl/element-procs.tcl 13 Oct 2013 10:03:24 -0000 1.32.2.6 @@ -188,18 +188,15 @@ # If the widget is a submit widget, remember it # All submit widgets are optional - if { $opts(widget) eq "submit" || \ - [string equal $opts(widget) "button"] } { + if { $opts(widget) eq "submit" || $opts(widget) eq "button" } { set form_properties(has_submit) 1 set opts(optional) 1 if { ! [info exists opts(value)] } { set opts(value) $opts(label) } if { ! [info exists opts(label)] } { set opts(label) $opts(value) } } # If the widget is a checkbox or radio widget, set attributes - if { $opts(widget) eq "radio" || \ - [string equal $opts(widget) "checkbox"] } { - + if { $opts(widget) eq "radio" || $opts(widget) eq "checkbox" } { # If there's no legend text, no point to generate the fieldset if { ![info exists opts(legendtext)] } { if { [info exists opts(legend)] || [info exists opts(fieldset)] } { @@ -296,7 +293,7 @@ template::util::get_opts $args - if { [string equal $opts(widget) "hidden"] + if { $opts(widget) eq "hidden" && [info exists opts(sign)] && $opts(sign) && [info exists opts(value)] } { @@ -427,7 +424,7 @@ set is_optional [info exists element(optional)] # if the element is optional and the value is an empty string, then ignore - if { $is_optional && [string equal [lindex $values 0] {}] } { + if { $is_optional && [lindex $values 0] eq "" } { set values [list] # also clobber the value(s) for a submit widget @@ -597,7 +594,7 @@ set transform_proc "::template::data::transform::$datatype" - if {[info commands $transform_proc] eq {}} { + if {[info commands $transform_proc] eq ""} { set values [ns_querygetall $element(id)] @@ -747,9 +744,9 @@ define values from value, if the latter is more defined } { upvar opts opts - # values is always defined, init to "" from template::element::defaults + # opts(values) is always defined, init to "" from template::element::defaults if { [info exists opts(value)] && [llength $opts(values)] == 0 } { - if { [string equal opts(value) {}] } { + if { $opts(value) eq "" } { set opts(values) [list] } else { set opts(values) [list $opts(value)] Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -N -r1.45.2.4 -r1.45.2.5 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 11 Oct 2013 08:12:31 -0000 1.45.2.4 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 13 Oct 2013 10:03:24 -0000 1.45.2.5 @@ -159,7 +159,7 @@ set formaction [get_action $id] # If we were in display mode, and a button was clicked, we should be in edit mode now - if { $submission && [string equal [ns_queryget "form:mode"] "display"] } { + if { $submission && [ns_queryget "form:mode"] eq "display" } { set opts(mode) "edit" set submission 0 } Index: openacs-4/packages/acs-templating/tcl/table-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/table-procs.tcl,v diff -u -N -r1.7 -r1.7.10.1 --- openacs-4/packages/acs-templating/tcl/table-procs.tcl 10 Jan 2007 21:22:12 -0000 1.7 +++ openacs-4/packages/acs-templating/tcl/table-procs.tcl 13 Oct 2013 10:03:24 -0000 1.7.10.1 @@ -211,16 +211,15 @@ set row(name) $column_name set label [lindex $column 0] - if {$label eq {}} { + if {$label eq ""} { set label $column_name } set orderby_clause [lindex $column 1] - if {$orderby_clause eq {}} { + if {$orderby_clause eq ""} { set orderby_clause $column_name } - if { [info exists widget(orderby)] && \ - [string equal $column_name $widget(orderby)] } { + if { [info exists widget(orderby)] && $column_name eq $widget(orderby) } { set row(html) "$label" set row(selected) "t" } else { Index: openacs-4/packages/acs-templating/tcl/wizard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/wizard-procs.tcl,v diff -u -N -r1.10.10.3 -r1.10.10.4 --- openacs-4/packages/acs-templating/tcl/wizard-procs.tcl 5 Oct 2013 12:55:10 -0000 1.10.10.3 +++ openacs-4/packages/acs-templating/tcl/wizard-procs.tcl 13 Oct 2013 10:03:25 -0000 1.10.10.4 @@ -628,7 +628,7 @@ set param [lindex [split $param ":"] 0] if {$param ni $multiple_listed} { foreach check_param $properties(params) { - if { [string equal [lindex [split $check_param ":"] 0] $param] } { + if { [lindex [split $check_param ":"] 0] eq $param } { set value_list [ns_querygetall $param] for { set i 0 } { $i < [llength $value_list] } { incr i } { append url "&$param=[ns_urlencode [lindex $value_list $i]]"