Hey all,

The problem

I'm trying to do a system where users can fill up 10-minute slots, between 10:00 and 17:00.
There can be only one user per slot and one activity/slot per 10 minutes.

The Setup

For this i set calendar style Time grouping to Custom and specified Custom time grouping to be

00:00:00,
10:00:00,10:10:00,10:20:00,10:30:00,10:40:00,10:50:00,
11:00:00,11:10:00,11:20:00,11:30:00,11:40:00,11:50:00,
12:00:00,12:10:00,12:20:00,12:30:00,12:40:00,12:50:00,
13:00:00,13:10:00,13:20:00,13:30:00,13:40:00,13:50:00,
14:00:00,14:10:00,14:20:00,14:30:00,14:40:00,14:50:00,
15:00:00,15:10:00,15:20:00,15:30:00,15:40:00,15:50:00,
16:00:00,16:10:00,16:20:00,16:30:00,16:40:00,16:50:00

I also set Hours and Minutes in admin/settings/booking_timeslots to 0 and 10

The module

in the module (theming) code following statement is provided

$half_hour = ($view->style_options['groupby_times'] === 'half');

But my $view->style_options['groupby_times'] is set to "custom" and thus reverts to hour mode.

Possible design errors

On the settings page there is the helptext "The default length of time of a timeslot."
The way i see it this sets the duration of one event, not the length of a timeslot. Timeslot length appears to be based on calendar style alone.

Possible Solutions

What I try to accomplish could be done via 2 ways i think.

1-put extra options in admin/settings/booking_timeslots to set the actual length of a timeslot, so it overrides the calendar style and automaticcally divide an hour (or day) in x parts

2-support the "custom" groupby_times option, and find a way to deal with the string in $view->style_options['groupby_times_custom'] (which is a string returning the top code block of this post)

also, it's available, not avaliable, a small language error that runs throughout the helptexts and var names :)

But I would also like to thank you for the module you've written so far! I think it is and will be a great tool for people like me who search for this functionality.

Boris

Comments

borisbarowski’s picture

i tried to fix it myself and came up with the following (see attached file)
All edits made are to booking_timeslots.admin.inc and calendar-day.tpl.php

slots of 1-2-5-10-15-20-30 minutes now possible, and longer than one hour too.

not guaranteed to be stable or do what you have in mind, but it's a show that it can be done and how i would do it

edits:
calendar-day.tpl.php
line 74 and following
line 114
line 121 and following

booking_timeslots.admin.inc
entire file: adding/renaming vars and adding extra checks

code does not care anymore for views style options, all is defined in this module (so i chose option 1 from my original post)

borisbarowski’s picture

Ok, stupid me, the newest -dev release DOES account for custom style.
I fixed it another way, but building on the calendar style is a solution too.

I do recommend that it is explained on the settings page that when style is custom, the settings there don't mean anything, or at least don't seem to have any effect on the layout.

Boris

kenorb’s picture

Title: module does not account for custom style » support different table layout for custom timing

Thank you for report.
Similar issue here: #507176: Validating timeslots when creating a new booking where custom timing has been applied.
But you have right, it doesn't effect on the layout.
It should be done somehow.
Basically change should be applied to calendar-day.tpl.php file

kenorb’s picture

Status: Active » Needs review
StatusFileSize
new67.84 KB

You may try new submodule of booking_timeslots: custom_timeslots
After installing, you should have new content type and new settings page: admin/settings/booking_timeslots/custom_timeslots
For my purpose it's looks like in attachment.

pkeyes’s picture

I've installed latest dev version of the module and can't enable custom_timeslots because of a dependency on the cck_time module, which isn't available for drupal 6. Is there something I'm missing here? I did install and enable Install Profile API, disabled and re-installed booking_timeslots, but still no luck.

kenorb’s picture

Component: Code » booking_timeslots
socialnicheguru’s picture

does the cck_time field need to be added to the booking calendar view?

kenorb’s picture

#7 no, fields are included automatically in Custom Time Slot content type.

kenorb’s picture

Status: Needs review » Active
kenorb’s picture

Status: Active » Fixed

As in #2.
Feel free to re-open.

Status: Fixed » Closed (fixed)

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