hi,
nice module.. Is there a way to allow multiple days input (week)? When checking 'Multiple values' it only shows 2..
greetz,
Johannes

CommentFileSizeAuthor
#7 patch-0.txt992 bytesharry slaughter

Comments

Ozeuss’s picture

Do you mean adding to add several days for the same hours, so that it can be displayed as
sun, mon, thurs 8:00-16:00 , etc....
Right now you can add as many days as you want, because the module will display two additional blank fields (if you need more than 3, just submit the node and re-edit it).
but i think enabling a multiple select is better usability.
I might implement that and other stuff in the next couple of days.

Johannes De Boeck’s picture

Aah, thanks for replying,

It wasn't clear to me that I had to Submit the Node before I could add more days.. wicked..
What I was trying to do is:

Mon 08.00 - 12.00
Tue 08.00 - 17.00
Wen 08.00 - 12.00
Thu 08.00 - 17.00
Fri 08.00 - 17.00
Sat 12.00 - 18.00

Now I can :) Thanks!

(Would be nice though for end-user to be able to do it all in one time..)

scottrigby’s picture

it would be great to have 7 fields, and only show however many the user fills out.
Or start with 3, and have an ability to add fields by user as needed.

I've been looking for something to help with this, so looking forward to how it shapes up!

Also happy to test

Anonymous’s picture

+1 I would be interested in this as well.

I'm pretty sure that it would be a trivial amount of code to add/edit in order to get some more fields to appear when multiple values is enabled. However, I don't know where to being when doing that as I have remedial programming skills.

txcrew

mnapier’s picture

Here's what I did to have mine show 7 days on new content and 2 on editing. It's a quick fix at least, you could go into a lot more usability.


File: office_hours.module

Add this:
(change the first $dadd to the number of fields you want for newly created content counting 0 and change the second one for edit.)

      if ($delta == 0) {
      	$dadd = 6;
      	}
      else {
      	$dadd = 1;
      }

Before this:

foreach (range($delta,$delta+1) as $delta) {




Change this:

foreach (range($delta,$delta+1) as $delta) {

To this:

foreach (range($delta,$delta+$dadd) as $delta) {
Johannes De Boeck’s picture

Status: Active » Needs review

Cool! works like a charm..thank you.

Marking this as patch, unless someone else has a better idea

harry slaughter’s picture

StatusFileSize
new992 bytes

Here's an actual patch of this fix. I made one change. There will always be a total of 7 entry fields.

mnapier’s picture

I have cases where I still need the option to have more then 7 days which is why I left it so you'd get two additional days if you edit it. Just FYI.

Ozeuss’s picture

I'm implementing something similiar to this patch, but instead of changing code manually I've added an option box for the field (for number of widgets showing initially), and a description that explains to the user that if the forms gets submitted, more widgets will show.

Thanks for the input,
I intend to release this fix as part of a stable release of this module either tomorrow or the day after.

Ozeuss’s picture

Status: Needs review » Fixed

Marking as fixed, per new release.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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