Index: openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl,v diff -u -r1.32 -r1.33 --- openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 28 Oct 2024 16:04:31 -0000 1.32 +++ openacs-4/packages/acs-tcl/tcl/deprecated-procs.tcl 25 Nov 2024 13:18:27 -0000 1.33 @@ -4467,6 +4467,182 @@ ######################################################################## +# Functions emulating dropped AOLserver 2 behavior in AOLserver 3 or newer +######################################################################## + +ad_proc -deprecated ns_dbformvalue {formdata column type valuebyref} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 + + returnvalues: + -1 = Not there or value was "" + 0 = NULL, set value to NULL. + 1 = Got value, set value to it. + +} { + + upvar $valuebyref value + + if {[ns_set get $formdata $column.NULL] == "t"} { + set value "" + return 0 + } + + set value [ns_set get $formdata $column] + + if { [string match $value ""] } { + switch -- $type { + + date { + set value [ns_buildsqldate \ + [ns_set get $formdata $column.month] \ + [ns_set get $formdata $column.day] \ + [ns_set get $formdata $column.year]] + } + + time { + set value [ns_buildsqltime \ + [ns_set get $formdata $column.time] \ + [ns_set get $formdata $column.ampm]] + } + + datetime - + timestamp { + set value [ns_buildsqltimestamp \ + [ns_set get $formdata $column.month] \ + [ns_set get $formdata $column.day] \ + [ns_set get $formdata $column.year] \ + [ns_set get $formdata $column.time] \ + [ns_set get $formdata $column.ampm]] + } + + default { + } + } + } + if { [string match $value ""] } { + return -1 + } else { + return 1 + } +} + +ad_proc -deprecated ns_dbformvalueput {htmlform column type value} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + switch -- $type { + + date { + set retval [ns_formvalueput $htmlform $column.NULL f] + set retval [ns_formvalueput $retval $column.month \ + [ns_parsesqldate month $value]] + set retval [ns_formvalueput $retval $column.day \ + [ns_parsesqldate day $value]] + set retval [ns_formvalueput $retval $column.year \ + [ns_parsesqldate year $value]] + } + + time { + set retval [ns_formvalueput $htmlform $column.NULL f] + set retval [ns_formvalueput $retval $column.time \ + [ns_parsesqltime time $value]] + set retval [ns_formvalueput $retval $column.ampm \ + [ns_parsesqltime ampm $value]] + + } + + datetime - + timestamp { + set retval [ns_formvalueput $htmlform $column.NULL f] + set retval [ns_formvalueput $retval $column.month \ + [ns_parsesqltimestamp month $value]] + set retval [ns_formvalueput $retval $column.day \ + [ns_parsesqltimestamp day $value]] + set retval [ns_formvalueput $retval $column.year \ + [ns_parsesqltimestamp year $value]] + set retval [ns_formvalueput $retval $column.time \ + [ns_parsesqltimestamp time $value]] + set retval [ns_formvalueput $retval $column.ampm \ + [ns_parsesqltimestamp ampm $value]] + + } + + default { + + set retval [ns_formvalueput $htmlform $column $value] + } + } + return $retval +} + +ad_proc -private -deprecated _ns_updatebutton {table var} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + + upvar $var updatebutton + + if { ![info exists updatebutton] } { + set updatebutton "" + } + if { "" eq $updatebutton } { + db_with_handle db { + set updatebutton [ns_table value $db $table update_button_label] + } + } + if { "" eq $updatebutton } { + set updatebutton "Update Record" + } +} + +ad_proc -private -deprecated _http_read {timeout sock length} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + return [_ns_http_read $timeout $sock $length] + +} ;# _http_read + +# Tcl page support + +ad_proc -deprecated ns_putscript {conn ignored} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + ns_returnbadrequest $conn "Cannot PUT a script file" +} + +ad_proc -private -deprecated _ns_dateentrywidget {column} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + # _ns_dateentrywidget is not very popular and is not + # internationalized. We keep it for backward compatibility. It should + # become deprecated. + set NS(months) [list January February March April May June \ + July August September October November December] + + set output "  " + + return [ns_dbformvalueput $output $column date [lindex [split [ns_localsqltimestamp] " "] 0]] +} + +ad_proc -private -deprecated _ns_timeentrywidget {column} { + deprecated proc, functionality dropped between AOLserver 2 and AOLserver 3 +} { + set output " " + + return [ns_dbformvalueput $output $column time [lindex [split [ns_localsqltimestamp] " "] 1]] +} + + +######################################################################## # Functions based on undefined code ######################################################################## #