Closed (fixed)
Project:
Office Hours
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2012 at 13:12 UTC
Updated:
31 Mar 2013 at 22:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
Ozeuss commentedI'm afraid 14 fields are hard-wired to the DB. You might create 2 fields, and do some template magic, or patch.
Comment #2
johnvPerhaps it fits in Lazarus-Long's #1613110: New widget
Comment #3
johnvComment #4
WebmistressM commentedsubscribing. 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
Comment #5
johnvYep,
it would take some time to rewrite the current widget.
It might even take a database update!
Comment #6
jonhattanThe 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.
Comment #7
WebmistressM commentedApologies if the answer to this question is apparently obvious but, how does one "extend the widget" to allow for unlimited values?
Comment #8
johnvThat 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.
Comment #9
jonhattanSadly the data model is indirectly hardcoded to represent 14 values:
daycolumn values represent days in this way: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.
Comment #10
WebmistressM commentedYeah. 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.
Comment #11
johnvAttached 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;
Comment #12
johnv#1945230: Javascript for 'N time blocks per day' is not complete is created as a follow-up task.
Comment #13
johnv@WebmistressM , out of curiosity: which kind of customers do you have? Or, which kind of users would need >2 time blocks per day?
Comment #14
WebmistressM commentedThe 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)