This feature request should solve several ones:
#1229920: [AC] Possible integration of availability_calendars and rooms
#1307086: Relating price to custom states
#1083800: Notes per Day
#1800894: Stocks instead of state
Availability Calendar is a great module and it could be used for many case:
- Stocks with a per day basis
- Prices
- Availability (currently: the "states")
- Many other things...
It would be nice if other modules could integrate with availability calendar to provide such features. It's very difficult for now because "states" are validated before storing field in the database, and for many other actions on availability fields.
States management could be separated into specific widget and formatter and maybe in a submodule.
I do not know if I'm clear enough in my explanation.

Comments

fietserwin’s picture

I get the point (I think), but I think that the states are so strongly tight to this module that removing them (or replacing them with a pluggable system) would not leave much of this module. I think that maybe more than half of the code in this this module is not so much about rendering a calendar but rendering states on a calendar (and editing, updating and saving them).

Example: showing stock per day seems easy to do with Calendar. But, indeed, the other part of the code is mostly about defining bookings based on calendars, and that is what is missing in e.g. the Calendar module: interactivity with the calendar.

fietserwin’s picture

Due to other requests I'm currently looking into making an availability calendar an entity. That is, the table availability_calendar_calendar that is referred to by the availability field (property cid). I hope this turns out to be working and that it indeed will solve (some of) the problems i'm trying to solve with it.

If so, I could continue this work by making the availability states an entity as well. A fieldable (and exportable) entity so that people can add their own information needs. Do you think that doing so would give you enough hooks and other ways of programmatically and via the admin UI cooperate with this module?