PHP version: 5.2.9
Drupal version: 6.16
Bookings API: 6.x-1.0-alpha5
Views: 6.x-2.10
CCK: 6.x-2.6
Date API: 6.x-2.4

I'm trying to create a resource that is only available for a few hours each day. I then want to place a booking request within the few available hours, and disallow bookings outside those hours. I believe I've found a bug in the availability parameter interface such that the resource becomes either strictly available or strictly unavailable (Flexibility = Rigid) even if the Flexibility = Flexible setting is selected. Flexibility = Flexible does not appear to be saved when selected. I've attached screen shots to show what I did.

resource-1: Shows the resource with default availability of "Unavailable".

availability-2: Shows the availability I created for the resource, with Flexibility = Flexible.

availability-1: Shows what the availability looks like after saving the availability info. Note that the type is now "Strictly Available". If I try to edit the availability again the Flexibility value is "Rigid" instead of "Flexible".

booking-1: Shows what happens ("No conflicts found.") when I try to place a request that's outside the available hours.

I would expect to have a conflict when trying to book the resource outside the hours of availability. I suspect it's not working that way because "Strictly Available" is described in the documentation as "Strictly available will be bookable, whatever you do".

Sorry for the long-winded explanation. Is the behavior I'm seeing expected, or is it because the Flexibility setting isn't being saved properly?

Comments

Anonymous’s picture

Actually it's because there are a couple of bug in 1.x - and some of them are buried really deep I fear. Would you mind switching to 3.x?

sah62’s picture

Sure, I'll try again later today, but I had the same basic problem when I first tried this with 3.x. I switched back thinking the 1.x alpha release was more stable.

brein’s picture

First post
Same Issue here
If i do like this:

$now = date_convert(date_now(), DATE_OBJECT, DATE_DATETIME);
$date_diff = date_difference($record['start'], $now, 'minutes', 'DATE_DATETIME');
return;

It trigger on
date_difference($record['start'], $now, 'minutes', 'DATE_DATETIME')

Anonymous’s picture

Whats a problem with date_convert / date_difference got to do with Flexible Availabilities?

brein’s picture

Sorry wrong tree :-(
It was about bookingapi dev 3.x in function bookingsapi_conflict_check when one is trying to add a booking
Can you direct me to the proper tree :-)

Anonymous’s picture

Just post a new issue here: http://drupal.org/project/issues/bookingsapi :)

brein’s picture

thanks sorry about the trouble
1. time :-/
BTW: Greate work I like it

sah62’s picture

StatusFileSize
new72.26 KB
new17.68 KB
new14.22 KB
new13.89 KB

OK, I just uninstalled alpha 1.x and reinstalled dev 3.x. The issue exists in dev 3.x, too:

Set Flexibility = Flexible, Availability status = Available (see attachment availability-4.jpg)
Save (-> "The availability Lesson Hours has been created.", see attachment availability-5.jpg but note warnings)
Type is now shown as "Available". Edit again, and Flexibility = Rigid (ee attachment availability-6.jpg)

I also attached a screen shot (request-1.jpg) to show you what I see when I try to place a request and check for a conflict. The progress meter appears, but there's no check mark or red X shown to describe the result of the search.

I mentioned a warning above: I got a user warning (availability-5.jpg) when trying to create the resource. The table in my DB is named drupal_content_type_bookingsapi_resource, but it appears that a table named content_type_bookingsapi_resource is being looked for.

Hope this helps!

Anonymous’s picture

There shouldn't be flexible or rigid availabilities in 3.x (they simply dont make sense)? Are you sure you installed both Bookings API and Public Bookings in 3.x?

sah62’s picture

StatusFileSize
new137.63 KB

Definitely. Screen shot of installed bookings modules attached. Is there something else I can check? Is it possible that something wasn't removed properly in removing and installing the modules?

Anonymous’s picture

Could you send me a list of tables? And a list of columns in the bookings-tables?

sah62’s picture

Sure - I'll send them in a moment.

Anonymous’s picture

You're right .. it's still in the form.. somehow I never realized this (and only checked on the resource-page assuming that the form was created the same way, which would have been correct) My bad, I'll fix it.. SORRY!

Thanks for the data!

Anonymous’s picture

Version: 6.x-1.0-alpha5 » 6.x-3.x-dev
Status: Active » Fixed

Okay, its committed ..

sah62’s picture

Thanks! I'll pick up the new version as soon as it's available for download.

sah62’s picture

when should I expect to find the fix available for download? The most recent version is still dated 21 May.

Anonymous’s picture

It's committed, but I have no way to make a new release available .. It should be rebuild every 24h, so tomorrow morning at the latest.

Anonymous’s picture

Bookings API now has a new dev-release ;)

sah62’s picture

Fix confirmed - thank you!

Status: Fixed » Closed (fixed)

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