Index: openacs-4/packages/calendar/www/view-list-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-list-display.tcl,v diff -u -r1.33 -r1.34 --- openacs-4/packages/calendar/www/view-list-display.tcl 16 Jul 2009 11:31:56 -0000 1.33 +++ openacs-4/packages/calendar/www/view-list-display.tcl 27 Oct 2014 16:41:08 -0000 1.34 @@ -11,25 +11,25 @@ if { ![info exists show_calendar_name_p] } { set show_calendar_name_p 1 } -if { ![exists_and_not_null sort_by] } { +if { (![info exists sort_by] || $sort_by eq "") } { set sort_by "start_date" } -if { ![exists_and_not_null start_date] } { +if { (![info exists start_date] || $start_date eq "") } { set start_date [clock format [clock seconds] -format "%Y-%m-%d 00:00"] } -if { ![exists_and_not_null end_date] } { +if { (![info exists end_date] || $end_date eq "") } { set end_date [clock format [clock scan "+30 days" -base [clock scan $start_date]] -format "%Y-%m-%d 00:00"] } -if {[exists_and_not_null calendar_id_list]} { +if {([info exists calendar_id_list] && $calendar_id_list ne "")} { set calendars_clause [db_map dbqd.calendar.www.views.openacs_in_portal_calendar] } else { set calendars_clause [db_map dbqd.calendar.www.views.openacs_calendar] } -#if { ![exists_and_not_null period_days] } { +#if { (![info exists period_days] || $period_days eq "") } { # set period_days [parameter::get -parameter ListView_DefaultPeriodDays -default 31] #} else { # set end_date [clock format [clock scan "+${period_days} days" -base [clock scan $start_date]] -format "%Y-%m-%d 00:00"] @@ -40,19 +40,19 @@ set user_id [ad_conn user_id] # The title -if {[empty_string_p $start_date] && [empty_string_p $end_date]} { +if {$start_date eq "" && $end_date eq ""} { set title "" } -if {[empty_string_p $start_date] && ![empty_string_p $end_date]} { +if {$start_date eq "" && $end_date ne ""} { set title "[_ acs-datetime.to] [lc_time_fmt $end_date "%q"]" } -if {![empty_string_p $start_date] && [empty_string_p $end_date]} { +if {$start_date ne "" && $end_date eq ""} { set title "[_ acs-datetime.Items_from] [lc_time_fmt $start_date "%q"]" } -if {![empty_string_p $start_date] && ![empty_string_p $end_date]} { +if {$start_date ne "" && $end_date ne ""} { set title "[_ acs-datetime.Items_from] [lc_time_fmt $start_date "%q"] [_ acs-datetime.to] [lc_time_fmt $end_date "%q"]" } @@ -84,7 +84,7 @@ set interval_limitation_clause [db_map dbqd.calendar.www.views.list_interval_limitation] set order_by_clause " order by $sort_by" set additional_limitations_clause "" -if { [exists_and_not_null cal_system_type] } { +if { ([info exists cal_system_type] && $cal_system_type ne "") } { append additional_limitations_clause " and system_type = :cal_system_type " } @@ -118,15 +118,15 @@ set pretty_end_time "--" } - if {[string equal $pretty_start_time "00:00"]} { + if {$pretty_start_time eq "00:00"} { set pretty_start_time "--" } - if {[string equal $pretty_end_time "00:00"]} { + if {$pretty_end_time eq "00:00"} { set pretty_end_time "--" } - if {![string equal $pretty_start_date $last_pretty_start_date]} { + if {$pretty_start_date ne $last_pretty_start_date } { set last_pretty_start_date $pretty_start_date } @@ -205,7 +205,7 @@ set period_url_$i "[export_vars -base $self_url -url -entire_form {{period_days $i}}]\#calendar" } -if { [info exists export] && [string equal $export print] } { +if { [info exists export] && $export eq "print" } { set print_html [template::adp_parse [acs_root_dir]/packages/calendar/www/view-print-display [list &items items show_calendar_name_p $show_calendar_name_p]] ns_return 200 text/html $print_html ad_script_abort @@ -216,7 +216,7 @@ set the_form [ns_getform] - if { ![empty_string_p $the_form] } { + if { $the_form ne "" } { for { set i 0 } { $i < [ns_set size $the_form] } { incr i } { set varname [ns_set key $the_form $i] set varvalue [ns_set value $the_form $i]