views:

169

answers:

4

I'd like to manage a timetable using Drupal 6, there are several pieces of equipment on which an administrator distributes people who get to use the equipment.

Essentially I want a table of equipment versus day of the week. The plan shows the occupation of all equipment for the whole week.

What makes it more complicated is that the editing of the timetable should be very easy and quick. Usually people have the equipment for multiple days, so one should be able e.g. to drag an entry and fill out more days this way. I'd also like to have a selection of people visible that one could drag onto the timetable and fill it out that way. I assume one can do that with javascript, but I have no experience with that.

  • Is it possible to create something like that with the Drupal Forms API?

  • Any pointers/examples for the dragging javascript?

  • Or is there some existing software or Drupal module that can do that?

A: 

Couldn't Equipment be a Content Type, and have different properties as you describe? Then you can enter each piece of equipment as a node. This would save you a ton of time vs making it with the Form API.

CCK

TableField CCK

Kevin
A: 

Why don't you use the Event module? Basically, it gives you an Event node type. Then a view can generate the calendar page of all nodes.

Simon
The problem is not displaying the table, but easily editing it. One should be able to edit every day of one week for every piece of equipment at once in one page.
Fabian
+2  A: 

I've found a nice javascript example for drag and drop in a timetable, it should be possible to adapt that for my case. I'll just have to figure out how to best integrate it with Drupal.

Edit:

The script I've mentioned at the top of the answer did not work inside my Drupal installation so I switched to Jquery UI.

I've implemented it now as a custom Drupal module that uses JQuery UI for Drag&Drop functionality. I've enabled Drag&Drop for a HTML table, to save the timetable the elements of the table are read out via Javascript and then sent to my custom Drupal module using ajax.

Fabian
You might use ahah to dynamically get some kind of sub-forms, with 3 fields (date, equipment, user), then associate a draggable element to each sub-form. Each draggable element could have a button on it that opens a "pop-up" div containing the field widgets to allow you edit equipment/user values. Date should be hidden and set by javascript drag-n-drop. Just make sure you use #default_value on it in place of #value.
redShadow
A: 

Hi,

I am not exactly sure whether the MERCI module has every functionality you want. I ran some tests and it looks pretty good, works even better. It is though available only in the prerelease aplpha 5 version but it should do it's job.

To drag and drop. It should not be that difficult to improve the forms using some JQuery as @Fabian suggested.

Bery