The latest Calendar module code makes it possible to create default calendars for specific date fields, and that might be a handy addition to this module. I wrote it specifically with the idea of including it in profiles. I'll try to get back later and provide a patch, but the PHP docs at the top of the default calendar explains how it works.

Comments

karens’s picture

StatusFileSize
new1.82 KB

This patch will automatically create a calendar for each of the test dates. It adds a requirement for views and calendar, but it's handy to be able to see the created dates in a calendar.

It could also be done differently -- adding all dates to the same calendar -- but this patch makes a separate calendar for each.

karens’s picture

Status: Active » Needs review
dww’s picture

StatusFileSize
new2.48 KB

I like separate calendars for each type. It think it'd get *way* too confusing if they were all on the same calendar by default. ;)

That said, would it be possible to have a /calendar-all view, too? and/or a /calendar-(date|datestamp|datetime)-all for all subtypes?

I rerolled the patch to add a new configuration define (CCKDATETEST_ENABLE_CALENDAR) to control if this stuff happens. I know I frequently need to test signup with and without views, so it'd be nice not to always have the the calendars (though I'm happy to leave that constant default to TRUE). This patch will conflict with #338053: Add Date PHP4 since it's touching the same code, but that'll be easy to resolve. I also fixed a few whitespace problems and fixed the variable_set('calendar_default_view_options') to only get called if any calendar options were defined (e.g. if I site for some reason was installed with only the untimed content type or something).

dww’s picture

Status: Needs review » Fixed

Removed the PHP4 stuff, updated the README, and committed to HEAD. Thanks.

karens’s picture

Status: Fixed » Needs review
StatusFileSize
new2.31 KB

After working with this, I found that creating separate calendars for each date can bomb the server during the install process, and if we add more date options (like the repeat date fields I need to add) it gets even worse. I re-worked this to create a separate calendar for each type of timezone handling, so there will just be four calendars instead of a dozen calendars. And looking at all the fields that use the same timezone handling on the same calendar makes more sense anyway.

So here's a patch to switch that around.

karens’s picture

I guess you could also make a case for creating a separate calendar for each date type instead of each timezone handling type. The patch could be reworked to do that instead or to offer an option.

We don't want to do both, though, since we need to limit the number of default views we create. I found that the server went bananas when I added a few more fields and tried to create calendars for all of them. MYSQL server went away... MYSQL server went away... Over and over.