So let me get this straight. You want the calendar to look something like this...
code:
Sun Mon Tue Wed Thu Fri Sat
Rm1 Rm1 Rm1 Rm1 Rm1 Rm1 Rm1
Rm2 Rm2 Rm2 Rm2 Rm2 Rm2 Rm2
Rm3 Rm3 Rm3 Rm3 Rm3 Rm3 Rm3
Rm4 Rm4 Rm4 Rm4 Rm4 Rm4 Rm4
Rm1 Rm1 Rm1 Rm1 Rm1 Rm1 Rm1
Rm2 Rm2 Rm2 Rm2 Rm2 Rm2 Rm2
Rm3 Rm3 Rm3 Rm3 Rm3 Rm3 Rm3
Rm4 Rm4 Rm4 Rm4 Rm4 Rm4 Rm4
Rm1 Rm1 Rm1 Rm1 Rm1 Rm1 Rm1
Rm2 Rm2 Rm2 Rm2 Rm2 Rm2 Rm2
Rm3 Rm3 Rm3 Rm3 Rm3 Rm3 Rm3
Rm4 Rm4 Rm4 Rm4 Rm4 Rm4 Rm4
Rm1 Rm1 Rm1 Rm1 Rm1 Rm1 Rm1
Rm2 Rm2 Rm2 Rm2 Rm2 Rm2 Rm2
Rm3 Rm3 Rm3 Rm3 Rm3 Rm3 Rm3
Rm4 Rm4 Rm4 Rm4 Rm4 Rm4 Rm4
with Rm1, Rm2, Rm3, Rm4 colored differently. Is that correct?
If so, here's how you do it. First, you would create another field called "Room" in the Customize Event Fields screen. Make it a selectbox for Room1, Room2, Room3, Room4, and set the values to 1, 2, 3, 4 respectively. Then in your display template, you should have something looking vaguely like this.
code:
<% FOREACH GRID ROW %>
<% foreach $i (1 .. 4) {
#set background color to 4 shades of blue, for instance
if ($i == 1) { $bgc = "#000033"; }
if ($i == 2) { $bgc = "#000066"; }
if ($i == 3) { $bgc = "#000099"; }
if ($i == 4) { $bgc = "#0000CC"; }
%>
<TR BGCOLOR="<%= $bgc %>">
<% FOREACH GRID COLUMN %>
<TD VALIGN="top" WIDTH="14%">
<% IF DISPLAY %>
<% if ($i == 1) { %>
<B><%=$DAY->{'dd'}%></B><BR>
<% } %>
<% FOREACH EVENT %>
<% if ($EVENT->{'details'}->{'Room'} == $i) { %>
<FONT FACE="arial" SIZE="-2"> <%= $EVENT->{'details'}->{'title'} %></FONT><BR>
<% } %>
<% /FOREACH %>
<% /IF %>
</TD>
<% /FOREACH %>
</TR>
<% } %>
<% /FOREACH %>
First, let me say that I am just learning perl, so there may be some blatant errors in the perl specific code. Also, I didn't include any kind of month or week headers, but those should just be copy and pasted from the default calendar. Other than that, it should work.
Integrating this into a plugin with the same kind of adaptability we've come to expect from the rest of the script would be quite difficult, since it would require each calendar to support custom fields, including the number of resources and the background color for each (the two things I hard-coded into the code above), it would be much easier to integrate into a template than a plugin, except I'm not sure how you would handle saving varying numbers of resources' background colors. Perhaps a better solution will present itself when the meta-calendar support is added in the next release or two. Feel free to use this approach until then, though.
If you would like me to throw together a template for you with these properties, send me an email at david@wowgod.net, and I'll see if I can make some time for it.
Hope that helps.
------------------
[This message has been edited by TubaDave (edited February 22, 2002).]
[This message has been edited by TubaDave (edited February 22, 2002).]
[This message has been edited by TubaDave (edited February 22, 2002).]