Index: openacs-4/packages/xotcl-core/tcl/ical-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/ical-procs.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 27 Oct 2014 16:42:01 -0000 1.10 +++ openacs-4/packages/xotcl-core/tcl/ical-procs.tcl 21 Oct 2017 13:07:27 -0000 1.11 @@ -4,7 +4,7 @@ @author neumann@wu-wien.ac.at @creation-date July 20, 2005 - Incomplete backport from my calendar extensions + Incomplete backport from :calendar extensions } namespace eval ::xo { @@ -36,7 +36,7 @@ clock format [clock scan $time] -format "%Y%m%dT%H%M%SZ" -gmt 1 } ical proc tcl_time_to_local_day {time} { - VALUE=DATE:[my clock_to_local_day [clock scan $time]] + VALUE=DATE:[:clock_to_local_day [clock scan $time]] } ical proc utc_to_clock {utc_time} { clock scan $utc_time -format "%Y%m%dT%H%M%SZ" -gmt 1 @@ -111,7 +111,7 @@ set tag [string toupper $slot] } if {![info exists value]} { - if {[my exists $slot]} { + if {[info exists :$slot]} { set value [my $slot] } else { return "" @@ -126,21 +126,21 @@ } ::xo::ical::VCALITEM instproc start_end {} { - if {[my is_day_item]} { + if {[:is_day_item]} { append result \ - [my tag -conv tcl_time_to_local_day dtstart] \ - [my tag -conv tcl_time_to_local_day dtend] + [:tag -conv tcl_time_to_local_day dtstart] \ + [:tag -conv tcl_time_to_local_day dtend] } else { append result \ - [my tag -conv tcl_time_to_utc dtstart] \ - [my tag -conv tcl_time_to_utc dtend] + [:tag -conv tcl_time_to_utc dtstart] \ + [:tag -conv tcl_time_to_utc dtend] } } ::xo::ical::VCALITEM instproc as_ical {} { - set item_type [namespace tail [my info class]] + set item_type [namespace tail [:info class]] append t "BEGIN:$item_type\r\n" \ - [my ical_body] \ + [:ical_body] \ "END:$item_type\r\n" return $t } @@ -155,47 +155,46 @@ # might occur more than once). An option would be to handle these # as lists. # - my instvar creation_date last_modified dtstamp # # All date/time stamps are provided either by # the ANSI date (from postgres) or by a date # which can be processed via clock scan # - if {![info exists dtstamp]} {set dtstamp $creation_date} - if {![info exists last_modified]} {set last_modified $dtstamp} + if {![info exists :dtstamp]} {set :dtstamp ${:creation_date}} + if {![info exists :last_modified]} {set :last_modified ${:dtstamp}} - set tcl_stamp [::xo::db::tcl_date $dtstamp tz] - set tcl_creation_date [::xo::db::tcl_date $creation_date tz] - set tcl_last_modified [::xo::db::tcl_date $last_modified tz] + set tcl_stamp [::xo::db::tcl_date ${:dtstamp} tz] + set tcl_creation_date [::xo::db::tcl_date ${:creation_date} tz] + set tcl_last_modified [::xo::db::tcl_date ${:last_modified} tz] # status values: # VEVENT: TENTATIVE, CONFIRMED, CANCELLED # VTODO: NEEDS-ACTION, COMPLETED, IN-PROCESS, CANCELLED # VJOURNAL: DRAFT, FINAL, CANCELLED append t \ - [my tag -conv tcl_time_to_utc -value $tcl_creation_date created] \ - [my tag -conv tcl_time_to_utc -value $tcl_last_modified last-modified] \ - [my tag -conv tcl_time_to_utc -value $tcl_stamp dtstamp] \ - [my tag -conv tcl_time_to_utc dtstart] \ - [my tag -conv tcl_time_to_utc dtend] \ - [my tag -conv tcl_time_to_utc completed] \ - [my tag -conv tcl_time_to_utc percent-complete] \ - [my tag transp] \ - [my tag uid] \ - [my tag url] \ - [my tag geo] \ - [my tag priority] \ - [my tag sequence] \ - [my tag CLASS] \ - [my tag location] \ - [my tag status] \ - [my tag -conv text_to_ical description] \ - [my tag -conv text_to_ical summary] \ - [my tag -conv tcl_time_to_utc due] + [:tag -conv tcl_time_to_utc -value $tcl_creation_date created] \ + [:tag -conv tcl_time_to_utc -value $tcl_last_modified last-modified] \ + [:tag -conv tcl_time_to_utc -value $tcl_stamp dtstamp] \ + [:tag -conv tcl_time_to_utc dtstart] \ + [:tag -conv tcl_time_to_utc dtend] \ + [:tag -conv tcl_time_to_utc completed] \ + [:tag -conv tcl_time_to_utc percent-complete] \ + [:tag transp] \ + [:tag uid] \ + [:tag url] \ + [:tag geo] \ + [:tag priority] \ + [:tag sequence] \ + [:tag CLASS] \ + [:tag location] \ + [:tag status] \ + [:tag -conv text_to_ical description] \ + [:tag -conv text_to_ical summary] \ + [:tag -conv tcl_time_to_utc due] - if {[my exists formatted_recurrences]} { - append t [my set formatted_recurrences] + if {[info exists :formatted_recurrences]} { + append t ${:formatted_recurrences} } return $t } @@ -256,12 +255,12 @@ # Class create ::xo::ical::VCALENDAR -parameter {prodid version method} ::xo::ical::VCALENDAR instproc as_ical {} { - if {[my exists prodid]} {set prodid "PRODID:[my prodid]\n"} {set prodid ""} - if {[my exists method]} {set method "METHOD:[string toupper [my method]]\n"} {set method ""} - if {[my exists version]} {set version "VERSION:[my version]\n"} {set version "VERSION:2.0\n"} + if {[info exists :prodid]} {set prodid "PRODID:[:prodid]\n"} {set prodid ""} + if {[info exists :method]} {set method "METHOD:[string toupper [:method]]\n"} {set method ""} + if {[info exists :version]} {set version "VERSION:[:version]\n"} {set version "VERSION:2.0\n"} set t "" append t "BEGIN:VCALENDAR\n" $prodid $version $method - foreach i [my children] { + foreach i [:children] { append t [$i as_ical] } append t "END:VCALENDAR\n"