Index: openacs-4/packages/calendar/tcl/cal-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/cal-item-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/calendar/tcl/cal-item-procs.tcl 13 Aug 2003 16:08:33 -0000 1.13 +++ openacs-4/packages/calendar/tcl/cal-item-procs.tcl 3 Sep 2003 13:48:31 -0000 1.14 @@ -123,6 +123,11 @@ } ] + cal_assign_item_permission $cal_item_id $creation_user read + cal_assign_item_permission $cal_item_id $creation_user write + cal_assign_item_permission $cal_item_id $creation_user delete + cal_assign_item_permission $cal_item_id $creation_user admin + return $cal_item_id } Index: openacs-4/packages/calendar/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 26 Jul 2003 21:48:11 -0000 1.16 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 3 Sep 2003 13:48:31 -0000 1.17 @@ -313,3 +313,15 @@ } +ad_proc dt_valid_date_p { + date +} { + Returns 1 if "date" is a valid date specification, 0 otherwise. +} { + if [catch { clock scan $date }] { + return 0 + } else { + return 1 + } +} + Index: openacs-4/packages/calendar/www/cal-item-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.tcl,v diff -u -r1.14 -r1.15 --- openacs-4/packages/calendar/www/cal-item-new.tcl 18 Aug 2003 19:41:19 -0000 1.14 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 3 Sep 2003 13:48:31 -0000 1.15 @@ -15,14 +15,28 @@ {start_time ""} {end_time ""} } +auth::require_login +set package_id [ad_conn package_id] +set user_id [ad_conn user_id] + +if { [string equal $calendar_id "-1"] || [empty_string_p $calendar_id]} { + # Seamlessly create a private calendar if the user doesn't have one + + if { ![calendar_have_private_p $user_id] } { + calendar::new -owner_id $user_id -private_p "t" -calendar_name "Personal" -package_id $package_id + } + set calendar_id [calendar_have_private_p -return_id 1 $user_id] +} else { + ad_require_permission $calendar_id cal_item_create +} + + + if {![info exists item_type_id]} { set item_type_id "" } -set package_id [ad_conn package_id] -set user_id [ad_conn user_id] - set date [calendar::adjust_date -date $date -julian_date $julian_date] set calendar_list [calendar::calendar_list]