Hi,
I am using this nice module on a site for a customer. Actually we have a problem with the drag & drop functionality, allowing i.e. to put Sunday after Tuesday, which is not useful for us and confuses the end users (people with little computer experience).
How can we remove it?

Thanks!

Comments

Aldus’s picture

it's just a simple question. Could someone try to answer?

johnv’s picture

I have tried to find it. code says explicitly that it is turned off, but some lower level code re-activates it... - so, no luck yet.

Aldus’s picture

In facts I also found that part of code, where the draggable table function is commented out... but yes, there must be something else...

Ozeuss’s picture

Just commited a fix for this-
field module apparently changed handling and naming of the function and theming override didn't work as well. I used theme_register_alter to force OH's theme function.
The dev version should be updated soon.

Ozeuss’s picture

Status: Active » Fixed
johnv’s picture

Category: support » feature
Status: Fixed » Needs work
StatusFileSize
new23.93 KB

That's nice!

But now the table header is out-of-sync. See attached screenshot.

joelstein’s picture

Priority: Normal » Major

The way you implemented this actually overrides ALL multiple value fields, not just those using the Office Hours field. Hence, it is now impossible to drag and drop other multiple value fields, like a multiple value text or node reference field, for example.

Another method of theming this form should be used—one that doesn't break other modules' fields.

joelstein’s picture

Title: Drag & Drop - possible to turn it off? » Disable drag & drop for Office Hours fields (only)
StatusFileSize
new968 bytes

Here's a quick way to accomplish this. Basically, check if the field we are theming is an Office Hours field, and if not, use theme_field_multiple_value_form() to theme the field.

I also commented out the drupal_add_tabledrag() function, which is the real function which converts the table to a draggable table.

I'm not well-versed in the Field API, but I'm sure there's a better way to accomplish this.

johnv’s picture

StatusFileSize
new16.25 KB

Ah, now I understand why I have this strangest thing in my system (see screenshot):
- a multivalue field, required, with the Required asterisk on the last row (which IS row[0] )
- my first-day of week is monday, so sunday (index 0) is shift to last place.

johnv’s picture

Status: Needs work » Fixed

joelsteind's modification and other improvements have been comitted.
http://drupalcode.org/project/office_hours.git/commit/70a0bca

joelstein’s picture

Excellent, thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.