/tcl/dotlrn-calendar-procs.tcl (+3 -3)
62 62         set package_id [dotlrn::mount_package \
63 63                 -package_key [package_key] \
64 64                 -url [package_key] \
65 65                 -directory_p "t"]
66 66
67 67         # We have to store this package_id!
68 68         # This is the package_id for the calendar instantiation of dotLRN
69 69         parameter::set_from_package_key \
70 70                 -package_key [my_package_key] \
71 71                 -parameter main_calendar_package_id \
72 72                 -value $package_id
73 73     }
74 74
75 75     dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] -package_key [my_package_key]
76 76 }
77 77
78 78 ad_proc -public dotlrn_calendar::remove_applet {
79 79 } {
80 80     One-time destroy for when the entire applet is removed from dotlrn.
81 81 } {
82       ad_return_complaint 1 "[applet_key] remove_applet not implimented!"
  82     ad_return_complaint 1 "[applet_key] remove_applet not implemented!"
83 83 }
84 84
85 85 ad_proc -public dotlrn_calendar::calendar_create_helper {
86 86     {-community_id:required}
87 87     {-package_id:required}
88 88 } {
89 89     A helper proc to create a calendar for a comm, returns the new calendar_id
90 90 } {
91 91     # create the community's calendar, the "f" is for a public calendar
92 92     set community_name [dotlrn_community::get_community_name $community_id]
93 93     # return [calendar_create [ad_conn "user_id"] "f" $community_name]
94 94
95 95     # New calendar proc
96 96     return [calendar::new \
97 97             -owner_id [ad_conn user_id] \
98 98             -private_p "f" \
99 99             -calendar_name $community_name \
100 100             -package_id $package_id]
101 101 }
102 102
 
244 244     # set up the calendar and full calendar portlets using add_portlet_helper
245 245     #
246 246
247 247     set args [ns_set create]
248 248     ns_set put $args calendar_id $calendar_id
249 249     ns_set put $args scoped_p $scoped_p
250 250     ns_set put $args param_action "overwrite"
251 251     ns_set put $args full_portlet_page_name ""
252 252
253 253     dotlrn_calendar::add_portlet_helper $portal_id $args
254 254
255 255     # this should return the package_id
256 256     return $package_id
257 257 }
258 258
259 259 ad_proc -public dotlrn_calendar::remove_applet_from_community {
260 260     community_id
261 261 } {
262 262     remove the applet from the community
263 263 } {       
264       ad_return_complaint 1 "[applet_key] remove_applet_from_community not implimented!"
  264     ad_return_complaint 1 "[applet_key] remove_applet_from_community not implemented!"
265 265 }
266 266
267 267 ad_proc -public dotlrn_calendar::add_user {
268 268     user_id
269 269 } {
270 270     Called once when a user is added as a dotlrn user.
271 271     Create a private, personal, global calendar for the
272 272     user if they don't have one, and add both calendar portlets
273 273     to the user's portal
274 274 } {
275 275     set calendar_id [calendar::have_private_p -return_id 1 -party_id $user_id]
276 276    
277 277     if {$calendar_id == 0} {
278 278         # HERE we need to find the package ID for the calendar instance at the top level
279 279         # How we do this is a tad tricky
280 280         # set calendar_id [calendar_create $user_id "t" "Personal"]
281 281         set calendar_id [calendar::new \
282 282                 -owner_id $user_id \
283 283                 -private_p "t" \
284 284                 -calendar_name "Personal" \