Custom availability states and legend
mdowsett - September 10, 2008 - 13:08
| Project: | Availability Calendars |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | feature request |
| Priority: | normal |
| Assigned: | nicholas.alipaz |
| Status: | active |
Description
It'd be nice to be able to set the colors of the statuses in the UI...I had changed it the css file and then upgraded and of course lost those changes.
Great module!

#1
I'm planning to make the statuses customisable so you could have more than just available, not available and maybe available. With each of those you could specify a colour, or at least a style to use from a stylesheet (haven't thought that through fully yet).
We'd also build the legend from that list. Going to close #306464: legend and merge it into this one.
#2
Legend has been fixed in 6.x using latest dev, I will not be backporting. Will work on configurable states.
#3
Where are you on this? This is another job that I need to implement for a client. Since it's a paid job, I can work on this task right away, unless you've got a reason not to.
I would like to tie this into the work I'm proposing to do on #331151: Ability to use javascript to select availability dates? as well.
#4
that would be great if you have time. I have been too busy to look at this.
#5
Great. I will start working on a patch this week.
#6
Here's a patch to add customizable labels to Availability Calendars.
If you don't set up custom labels, the default labels are used, as before.
Custom labels can be styled using CSS classes derived from the names of the labels.
You can see the generated style for your label in the administration form, but it is simply str_replace(" ", "-", strtolower($label)).
Ex. "My Label" => "my-label"
Default labels keep the CSS classes they have always had.
A word for production sites that wish to use custom labels.
In your database, you will have days marked as follows:
0 => 'Available'
1 => 'Fully booked'
2 => 'Provisionally booked'
In order to ensure a smooth transition, make your custom label ids match up with your existing data. So, if you want to create a custom label for days marked "Fully Booked", create that label before creating any others. Create the "Provisionally booked" replacement label next. Finally, create the "Available" substitute and set that label as the default.
For fresh installs, you don't need to worry about this.
New requirement
In order to make the interface nice, I have used the AHAH Helper module, so you must download and install that module.
#7
This doesn't seem to be patched against latest dev, any way to correct this? Here are the rejects I got:
BTW, this is a pretty extensive change, so will certainly require some additional testing before we commit it, but I definitely like the concept.
#8
Sorry about that.
Here's an updated patch.
#9
I will test the patch today, hopefully others will join.
As for the original post:
The css issue can be overcome by making a copy of the "offending css" in your theme's stylesheet or other stylesheet not ever being changed on upgrades and changing it there. I don't believe that an interface for this is really warranted, but others please give opinions if you like.