[development] associate dates to nodes
larry at garfieldtech.com
Mon Jul 9 19:13:36 UTC 2007
That is how I would suggest approaching this problem as well. I did a non-Drupal reservation system not too long ago, and you should definitely treat a "reservation" as a separate entity that references the "room" being reserved. That will scale far better, as well as flow better logically.
One caveat, though. "most custom work can be accomplished with CCK, views, and a small custom module to implement hook_form_alter and few others." That's true, but sometimes those form_alters get... messy. :-) (I just launched a beta for a site where I'm doing 90% of the work with OG, Views, and CCK, and the form_alter code and menu hook I need to make that into what I actually want is scary.)
On Mon, 9 Jul 2007 11:32:31 -0500, "Mark Fredrickson" <mark.m.fredrickson at gmail.com> wrote:
> It sounds to me like most of what you want can be handled with CCK.
> However, your validation requirements are probably not going to be met
> out of the box by any existing module.
> I would suggest setting up two content types:
> 1. Room/House
> 2. Reservation
> Use CCK's node reference field to join reservations to rooms. Add a
> date field to your reservation type.
> In a custom module add a form validation function (read up on the
> Forms API and on hook_form_alter) that checks to make sure that a
> given date is not already taken for the target room node.
> The deep, dark secret of Drupal development these days is that most
> custom work can be accomplished with CCK, views, and a small custom
> module to implement hook_form_alter and few others.
> Good luck!
> On 7/9/07, Alex Moreno <al3xmor3no at gmail.com> wrote:
>> Good moorning,
>> i´m newbie developing on drupal, so please beard with me.
>> I need to know if this is possible to do and where should i read more
>> documentation... the question is that i need to associate different
> dates to
>> each node created. The working should be similar to a reservation system
>> a hotel. The administrator must be able to insert new houses or bedrooms
>> the annonymous users must be able to associate dates in nodes, having in
>> mind that the same node cannot have the same date associated... Do i
> need to
>> develop a module or is it possible to make it easier in any other way?
>> Thanks in advance for your suggestions,
>> best regards.
More information about the development