Hi,

I am looking for a solution for a friend to have his tennis courts reservations per hour possible to reserve through the internet.
Will this module help with this please?

greetings,
Martijn

Comments

developer-x’s picture

Assigned: Unassigned » developer-x

Yes, this module should be able to do this. I'd be happy to help - if you have some specific requirements, I'll try to provide some guidance.

- x

developer-x’s picture

Status: Active » Fixed
summit’s picture

Hi, Didn't have time to work on this yet. Sorry.
greetings,
Martijn

pipicom’s picture

Hello Mr. Developer-X,

I need to develop a site similar to the above tennis courts reservations scenario.
Is it possible that the calendar has a "book now" button on each day that leads to the "+ Add a Meeting" form (you already have) with the date already filled in? In my scenario the user shouldn't have to remember what day the court was available. It would be better for him to see the available court (calendar page), press a button or something similar on the specific date and give only some extra info (name, address) on the next page (booking form).

A similar implementation of the above can be seen here (http://hoteldemo.mightech.de/bookingcalendar2/2010-W50) however your module seems superior in many ways.

Appreciate your time..

developer-x’s picture

I suspect that the functionality added in the demo was done the following way:

1. They installed the prepopulate module - http://drupal.org/project/prepopulate - that lets you prepopulate a form via query parms.
2. They copied calendar-month-node.tpl.php to their theme directory, then added a "+" link to "node/add/node/add/agreservation" with the selected date added to the query string.

You should be able to do the same thing and the eventbookings module will pick up the date from the prepopulated value.

- x

pipicom’s picture

Damn, you are fast ;)

Thanks man..

developer-x’s picture

Ok - I admit, I was a little intrigued....

So, I played around and got it to worked. It's deployed on the demo calendar if you want to check it out. You do need the prepopulate module, but I was wrong about the template - instead, use calendar-datebox.tpl.php. Here is the code I used:

<?php
// $Id: calendar-datebox.tpl.php,v 1.2.2.2 2008/06/10 16:05:16 karens Exp $
/**
 * @file 
 * Template to display the date box in a calendar.
 *
 * - $view: The view.
 * - $granularity: The type of calendar this box is in -- year, month, day, or week.
 * - $mini: Whether or not this is a mini calendar.
 * - $class: The class for this box -- mini-on, mini-off, or day.
 * - $day:  The day of the month.
 * - $date: The current date, in the form YYYY-MM-DD.
 * - $link: A formatted link to the calendar day view for this day.
 * - $url:  The url to the calendar day view for this day.
 * - $selected: Whether or not this day has any items.
 * - $items: An array of items for this day.
 */
$from = date('h:iA'); // Match input format
$to = date('h:iA', time() + 1 * 60 * 60); // 1 hour
$uri = $_SERVER["REQUEST_URI"];
$uri = preg_replace( '/^\\//','',$uri);
$date = date_format(date_make_date($date), 'M d Y'); // Match input format
?>
<a href="/node/add/event?edit[field_date][value][date]=<?php print $date;?>&edit[field_date][value][time]=<?php print $from;?>&edit[field_date][value2][date]=<?php print $date;?>&edit[field_date][value2][time]=<?php print $to;?>&destination=<?php print $uri;?>">+</a>
<div class="<?php print $granularity ?> <?php print $class; ?>"> <?php print $link; ?> </div>

Note: Its really important the date/time format exactly matches the input format set for the date field. So, double check that if it doesn't work

pipicom’s picture

Just checked the demo calendar, you are awesome!
I will implement your solution and send a demo link for everyone to see, hopefully really soon..

Status: Fixed » Closed (fixed)

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

apoc1’s picture

Hey, nice solution! It's very useful, but what about the week overview?

I had in mind to make the week overview like this: custom hour grouping from 7am till 9pm, and in every row (empty or with an event listed) an '+ icon'. Hitting that link should bring you to the form where the date is filled, based on which column you clicked it, and the hour-lapse filled in, based on which row you clicked it.

I have been playing around with your code for the month-view, but I can't figure it out how to get it working.