Hi,
Just install your module which is look very good, but we need to have 3 open period per day at least.
How to manage that ?

In the field's conf, there is
Number of value : 14. 14 hours blocks is the current default. See below for limiting it

We will need 21, 28, etc.

Thanks !

CommentFileSizeAuthor
#11 office_hours_1710258_blocks_per_day.patch14.01 KBjohnv

Comments

Ozeuss’s picture

I'm afraid 14 fields are hard-wired to the DB. You might create 2 fields, and do some template magic, or patch.

johnv’s picture

Perhaps it fits in Lazarus-Long's #1613110: New widget

johnv’s picture

Title: upgrade to 21, 28... bloc hours per week » More than 2 Time Blocks Per Day: upgrade to 21, 28... hours per week
WebmistressM’s picture

subscribing. For now, all I can do is tell people they cannot add more than 2 "open" slots per day and hope they dont ask why. Heheh

johnv’s picture

Version: 7.x-1.0 » 7.x-1.x-dev
Status: Active » Postponed

Yep,
it would take some time to rewrite the current widget.
It might even take a database update!

jonhattan’s picture

The limitation to 14 doesn't imply anything. It will work the same with unlimited values. To allow any number of periods per day it's only needed to extend the widget.

WebmistressM’s picture

Apologies if the answer to this question is apparently obvious but, how does one "extend the widget" to allow for unlimited values?

johnv’s picture

That would be programming the widget. ATM it only creates the possibity for 1 extra line, if the indicator is set.
You could let it depend on the multivalue settings: 14 indicates 1 extra line, 21 indicates 2 extra lines.
OTOH, I don't think that the formatter is robust for this change, I doubt it: it now calculates with odd/even index.

jonhattan’s picture

Component: User interface » Code

Sadly the data model is indirectly hardcoded to represent 14 values: day column values represent days in this way:

0 sunday AM (first value)
1 sunday PM (second value)
2 monday AM (first value)
3 monday PM (second value)
...

Until I saw this I was hoping to try and help improving this module, but it would be almost a complete revamp in a 2.x serie. I'm also thinking of creating a new module.

WebmistressM’s picture

Yeah. Looks like it was set in stone. The module name "Office Hours" indicates it kind of is meant to meet normal business hour situations (most businesses have 2 shifts, divided by that hour of lunch). Worth a shot.

johnv’s picture

StatusFileSize
new14.01 KB

Attached patch makes it possible to add more then 2 blocks per day.
Please test, and give your feedback.

- On several locations, we are not assuming 2 values, but read all available values.
- On the Field settings, the checkbox 'Add more hours' , is replaced by an selectbox, with values 1-10.
- The field widget supports multiple blocks per day, but must be refined to support Unlimited.
- When saving the database, the column 'day' does not contain the values 0,1,2,3.. , 13, but 0, 2, 4, 12. Effectively, it contains (daynumber * 2)

Todo:
- implement better widget
- implement hook-update_N(), to normalize existing field settings;
- implement hook-update_N(), to normalize column 'day' to 'normal' day numbers;

johnv’s picture

Status: Postponed » Fixed
johnv’s picture

@WebmistressM , out of curiosity: which kind of customers do you have? Or, which kind of users would need >2 time blocks per day?

WebmistressM’s picture

The need of more than 2 "open" time blocks per day stems from having users who log into a syystem for a certain number of hours. Those hours are displayed so that people know they are/should be online. Everyone has different schedules so there is likely going to be people who might be available 6 hours a day but in 2 hour increments (morning, mid-day, evening)

Status: Fixed » Closed (fixed)

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