Dirk asked me to post this idea on a calendar API:
For many applications, you'd like to be able to map things onto the calendar. For example, with project manager, I'd like to show a user's tasks on the calendar. For room-reservations, you'd like to show when things are available and when they're not, etc..
This is my wish list idea for calendar:
I'd like to be able to pass calendar a list of items to print out, and get back a calendar with those entries in it.
For example, maybe something like this:
In .tcl:
set calendar_definition {
{month 6}
{year 2003}
{entries
{3 "My HTML to go on day 3"}
{5 "<input type="checkbox" name="whatever" value="avalue">My HTML to go on day 5</input>"}
{25 "My HTML to go on day 25"}
}
}
set calendar_html "<form action="somefile">[calendar_html -definition $calendar_definition -bgcolor "ffffff" -fgcolor "000000"]</form>"
Then in the .adp file:
@calendar_html@
Something like this would be a lot closer to the holy grail with calendar of being able to display arbitrary types of data. Then the application developer could build the definition however they want, using data from whatever tables, etc.. They could even mix up several types of data, and refer people to different mounted packages, etc..
Notice you'd also be able to do en masse sort of operations.
The problem is that a lot of the display information is done in Tcl, which is very reminiscent of ACS 3 days. I'm not sure what the best way around that is. I also haven't used the OpenACS calendar, so I don't know anything about it's data model or code.
Another problem is that the idea as currently stated does not handle going to the next calendar page, etc.. You wouldn't want to pass all the data to a calendar function, I imagine..
Thoughts?
It seems like we might be able to improve on this idea, and implement it pretty easily. This would (in my book) be the single most useful improvement I could imagine for calendar. It then becomes really really useful!