Commit e6f6c7a5 authored by Frank Bergmann's avatar Frank Bergmann

- fixed duplicate calendar name bug

parent d2f5c89c
...@@ -342,9 +342,26 @@ ad_proc -public calendar::adjust_date { ...@@ -342,9 +342,26 @@ ad_proc -public calendar::adjust_date {
ad_proc -public calendar::new { ad_proc -public calendar::new {
{-owner_id:required} {-owner_id:required}
{-private_p "f"} {-private_p "f"}
{-calendar_name:required} {-calendar_name ""}
{-package_id ""} {-package_id ""}
} { } {
set duplicate_cal_p [db_string duplicate_cal "
select count(*)
from calendars
where calendar_name = :calendar_name
"]
if {[empty_string_p $calendar_name] || $duplicate_cal_p} {
set user_name [db_string uname "select im_name_from_user_id([ad_get_user_id])"]
if {"f" != $private_p} {
set calendar_name [lang::message::lookup "" calendar.Pers_Cal_Name "%user_name% Personal Calendar"]
} else {
set calendar_name [lang::message::lookup "" calendar.Pub_Cal_Name "%user_name% Public Calendar"]
}
}
if { [empty_string_p $package_id] } { if { [empty_string_p $package_id] } {
set package_id [ad_conn package_id] set package_id [ad_conn package_id]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment