I am developing a module (my first) for a corporate web site. The module's requirements:

1. Allow creation of events that occur at a specific date, time and place, and have a maximum number of attendees (i.e. a seminar).

2. Allow creation of reservation requests for a specific event. The reservation should contain contact information and the number of attendees.

3. Display events occurring in the next 2 weeks, including the number of available spaces.

As I understand it, I need to create two Drupal node types: event, reservation. To do this, do I need to create two distinct modules? I am assuming that is required so that I can have two separate implementations of hook_*:

myevent_form()
myevent_load()
myevent_update()

myreservation_form()
myreservation_load()
myreservation_update()

Am I correct? Do you have any other recommendations of where I can find a similar module modules to use as a guide?

Thank you,
Aaron

Comments

Anonymous’s picture

Well, I think a good start would be http://drupal.org/project/event and http://drupal.org/node/19424 would be a good start. #1 and #3 can be taken care of with the event module. You'll need to install the flexinode module, and when you use that to create a new node type (no programming required), you can just put in a number of atnedees field. Depending on your needs you may need to hack the event module, or create a module which extends it to do what you want.

The RSVP module probably won't do what you need, since it is more of an 'invite' than a signup, but it should give you an idea how to go about creating a module to do what you want.

ADLongwell’s picture

Thanks for the quick and useful response. Those modules have been a great starting point. I may end up building my own event module, as the existing one is missing some needed functionality, and parts are overbuilt for my purposes. It is a great example nonetheless.

I plan on using two distinct modules to implement two types of nodes: event and reservation. Is this necessary? Or is it possible to create more than one type of node in a single module?

q0rban’s picture

This is a great idea... can you somehow create this as a seperate module to use whatever features the event.module already has, as well as adds the features that you need?

Just a thought, but regardless.. I am very interested in this idea, as I'm trying to set up a site that allows reservations for hair appointments... Let me know if I can help in any way...
cheers

nevets’s picture

I have not tried it, but there is a signup module that sounds like it might do the reservation part of what you want. It can be found at http://drupal.org/project/signup