tags:

views:

48

answers:

3

I have company website, with many offices around the world (around 50 offices). The company want to create a gift giveaway with the employees in a specific company each specific day.

For example:

Office 1: will do the giveaway the days: 1/1/2010, 7/1/2010, 15/1/2010, etc...
Office 2: the days: 2/1/2010, 9/1/2010, 19/1/2010, etc...
Office 3: ....
Office 50: ...

(the days are setup manually to specific offices, no need of an algorithm here)

I have a node per Office, it's a CCK content type with details of each office (location, phone, email, etc), now I need to assign those days to the offices.

But my problem here is that I don't need to create events (or at least node events) because I don't need to store any data in the event. Just need to say: Office 1? Yes, days 1/1/2010, 7/1/2010, etc...
Nothing else, just to know the dates.

And, if possible, make them available to display in the calendar module.

What is your suggestion?

A: 

Withs CCK and date module you can create date fields, but if you have many fields you want to add, this might not be the best solution.

You have two general ways of solving this issue. Either you need store each date. This could be done with date field, not sure if it can handle multiple values, node reference or similar. This is inefective it some ways, but will make it easy to generate calendar view.

You could also write a string with as the date info and let php convert it to dates. This route will make it easier to create and store the data, but will make it a lot harder to get things integrated with calendar.

The fatest / easiest solution would probably be node reference with a date module, combined with a script to create all the nodes need. Instead of making them inside Drupal.

You could also create a custom module that stores this info for you. It would be a more longterm solution and require more work to integrate it with views and date/calendar modules.

There are many ways to go about this, but it really depends on your need, skill and time

googletorp
Yes, imagine add around 200 dates per Office per year. I think CCK date field is not good, specially for editing. Thanks
Leandro Ardissone
Things like that is good to include. 200 dates per office per year seems a bit much, would be easier to register the dates that's not used then.
googletorp
Sounds good. If there's a possibility to connect/link nodes between in some way I could create a node per each year day (event), and associate the offices to the day-nodes. But I think it's still a problem for the admin side, in case of need to modify the dates.What about create a vocabulary for each year, with all the days as terms?
Leandro Ardissone
You could use taxonomy, but you would get a hard time integrating it with calendar as dates.
googletorp
Yes, I'll use this configuration: Three content types: Office: with data of the office Days: with a node per day (365 * year) created programmatically and Giveaway: with two node-reference fields, one for Office and another for Day. I can create just Giveaway content type, and that's enough.And then only the views are remaining.
Leandro Ardissone
A: 

Why not use a plain old CCK text field with a good clear description of what it's for and how to format it with something in the help section to back it up?

Use a text area (multiple rows) and apply the default input format that converts lines line breaks. I like to use the mark down filter too.

You could also use multiple single line fields in place of a text area...

This assumes your users are smart enough to enter the correct info of course but that's what the help and description are for. If your users can't be trusted to enter the content in correctly then yes, go for something that forces them to do so.

Rimian
Yes, the problem is that the client needs an easy UI. And I think that add 200 entries per year in multiple single line fields will result in a huge form with lot of fields.Thanks
Leandro Ardissone
A: 

Ok I've found the solution myself and I want to share it with you:

Created three content types:

Office: with data of the office
Days: with a node per day (365 * year)
and Giveaway: with two node-reference fields, one for Office and another for Day.

(Days must be populated manually using a script that fills the upcoming 2 years or so).

So I can fill only Giveaway content type, and that's enough.

And then only the views are remaining.

Leandro Ardissone

related questions