[kronolith] Shared Calendars

Rick Stevens rstevens@vitalstream.com
Thu, 06 Jun 2002 13:09:00 -0700


I appologize for the cross posting, but this message addresses items in
the Horde, Horde Development and Kronolith realms, so I posted to all
three hoping to solicit suggestions.

I'm working on a shared calendar mechanism for virtual domains.  I'm
basing my work on the kronolith-1.0-RC3 code base.  The intent of the
shared calendar is as follows:

1) Users can set a preferences attribute to allow others to see their
calendar.  The people that are allowed to see it MUST be in the same
domain (e.g. if "fred@bedrock.com" sets the preference, others in the
"bedrock.com" domain may see it, but no one else).  This makes use of
the vinfo bits in IMP (using IMP authentication).

2) Users may also set a preferences attribute that allows others in
their domain to set appointments in their calendar.  These appointments
may be deleted by either the calendar owner OR the person who initially
made the appointment.  This requires adding another bit of data to the
appointment itself--the user ID who made the appointment.  This feature
is useful for, say, scheduling the use of a conference room, setting
up group meetings and the like.

At this time, I've got the preferences stuff set up AND I have the
changes necessary to the calendar itself (using the SQL backend--I've
not played with the mcal stuff).  I also have methods for picking up
which calendars are viewable by a user (when a user brings up
kronolith, a bit of code in base.php calls the SQL query to build
this list up).  Other bits of code prevent the deletion of an event
unless the user is the author of the event or the calendar's owner.

Now, here's where I run into a spot of bother.  I wish to show these
viewable calendars in a drop-down list in the Kronolith menu bar.
If a user selects one of these other calendars, I wish to replace the
current (user's) calendar with the one selected.

I can't find a simple Horde:: class that will build up this drop-down
menu (I find plenty of examples for mailboxes and the like, but they
are all application- and usage-specific).  Is there  a generic Horde
method for generating a drop-down list from a simple array of text
arguments and a way to pick up what the user selected?

There also doesn't appear to be a method for closing an open calendar.
I can certainly "disconnect()" the SQL connection, but that would leave
some crumbs around that we don't want.  I'll write a close routine
if necessary.

Going along with that, what is required to open a new calendar session?
I suppose I could borg the code at the end of kronolith/lib/base.php
and close (using the new function I guess I'll have to write), then
open the new calendar and force a browser refresh.  That seems a bit
draconian.  Is there an easier way or am I going to have to write
it?

Suggestions are welcome, either by posting to the message boards or
emailing me directly.  If I come up with a clean mechanism, I'll
certainly post patches.  I'm soliciting suggestions as I'd hate to
duplicate someone else's efforts and, if my efforts are deemed to
be useful, I want to make this update as clean and "horde-ish" as
I can.  You should be warned, however: I tend to overcomment my code.
If you don't like comments, then I'm not the coder for you!
-- 
----------------------------------------------------------------------
- Rick Stevens, SSE, VitalStream, Inc.      rstevens@vitalstream.com -
- 949-743-2010 (Voice)                    http://www.vitalstream.com -
-                                                                    -
-                Huked on foniks reely wurked for me!                -
----------------------------------------------------------------------