Hi,

Just found another bug - calendar-day.tpl.php has the line

for ($h = 10; $h<=16; $h++) {

Which shows the slots available from 10am to 4pm - these can be altered to show different times on the day view, but the actual bookings will only display if they are between 10am and 4pm.

Cheers, Garry.

Comments

kenorb’s picture

Category: bug » support
Status: Active » Fixed

Thanks for reporting this.

It was fixed recently:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/booking_tim...
You can change it on configuration page.
Make sure that you copied calendar-day.tpl.php into your theme dir.

Try the latest version.
If this doesn't work properly, please re-open.

GBain22’s picture

Status: Fixed » Active

I only installed this last week and it is the latest version - calendar-day.tpl.php is in my theme directory and the changes are showing but its not showing any bookings at any times other than those between 10am and 4pm.

GBain22’s picture

Version: 6.x-1.x-dev » 6.x-1.0

I apologise, this is for version 6.x1.0 and not the drupal 5 version. Was there a "fix" for this released?

kenorb’s picture

No, please download and try development version.
In 1.0 this functionality was not included. It will be in next release version.

GBain22’s picture

Hi,

I have installed the development version, and while it shows the new times - the appointments and bookings do still not appear in any times other than those from 10am to 4pm.

Is there somewhere in the code depicting that the calendar will only show these specific times?

Cheers, Garry.

kenorb’s picture

Did you copied already new version of calendar-day.tpl.php file into your theme folder and Cleared the cache?

GBain22’s picture

I just tried that and still no difference - here are 2 screenshots to show you what is happening.

http://www.sd1dev.co.uk/prescriptions/sites/all/month.JPG

http://www.sd1dev.co.uk/prescriptions/sites/all/day.JPG

kenorb’s picture

Now you have from 9, so not 10 anymore so it did work.
I think you could have this limit somewhere in Calendar View.

I've checked and after changed the settings on admin/settings/booking_timeslots/timeslots_settings 'Hour from:' and 'Hour to:' to 1 and 23, it's normally showing me full timetable from 1 to 23
Can you check if you have 24h hour format?

Can you dump for me your settings?

SELECT * FROM variable WHERE name LIKE "booking_timeslot_%"
GBain22’s picture

booking_timeslot_avaliable_slots s:1:"4";
booking_timeslot_field_name s:13:"field_deldate";
booking_timeslot_form_id s:12:"prescription";
booking_timeslot_hour_from s:1:"9";
booking_timeslot_hour_to s:2:"21";
booking_timeslot_length_hours s:1:"0";
booking_timeslot_length_minutes s:2:"59";

Sorry I should have mentioned, its working from 9am on the month/week view - just not on the day-view. I have it set to 59 mins per appointment as when it was the full 1 hour, it also booked the next slot (so booking 9am then caused 10am to be blocked out).

Cheers.

kenorb’s picture

From 1.0 to 1.dev there were changes in variable formats from string to array. You have still old format.
Can you make update.php? If this doesn't help, can you disable, and then uninstall and install, and then configure module again?
To make sure that you have fields and forms (instead of form_id and field_name) as array?
Something similar to:

'booking_timeslot_fields', 'a:1:{i:0;s:20:"field_party_datetime";}'
'booking_timeslot_forms', 'a:1:{i:0;s:5:"party";}'

I'm not sure, but it could cause some unexpected behaviour.
And tell me if that worked for you.

GBain22’s picture

I have ran update.php now and reinstalled the module - but I noticed the settings where still in place from before I disabled the module - is there a way to uninstall the module completely so no settings are saved?

I also tried clearing cache etc but it made no difference, when I ran the SQL on the db again I got this returned which shows exactly the same as before update.php was ran:

booking_timeslot_avaliable_slots s:1:"4";
booking_timeslot_fields a:1:{i:0;s:13:"field_deldate";}
booking_timeslot_forms a:1:{i:0;s:12:"prescription";}
booking_timeslot_hour_from s:1:"8";
booking_timeslot_hour_to s:2:"21";
booking_timeslot_length_hours s:1:"0";
booking_timeslot_length_minutes s:2:"59";

Do you think the problem could be with calendar-day.tpl.php as this is the only view that the appointment will not show on?

Cheers

kenorb’s picture

Yes, to remove all settings you Uninstalling it from Uninstall tab on admin/build/modules. But you already done this, so it's ok.

There could be main two reasons that it doesn't work.
1. Cache problem.
2. You haven't copied this TPL file into your theme file.

Solution for 1:
In README.txt you have this note:

- If you still don't see booking timeslots, edit your Calendar View, click on 'Theme: Information' and choose 'Rescan template files'.

I don't know why, but TPL files are refreshed very rare even you clear your cache.

Solution for 2:
Check if TPL file from latest version (calendar-day.tpl.php) is in your current theme dir:
In the same folder where you have theme .info file, that is:
SELECT filename FROM system WHERE type = 'theme' AND status = 1;

If you done everything above, you could have some unsupported modes in your calendar.
You may try to export your Calendar view (in Views list) and make a backup, if you have some special settings and revert settings in your Calendar View with 'Rescanning template files as well' as in point 1. And then check if that worked. When you test it, you can import your version again.
The last thing that you can do, is to test on fresh Drupal installation if it's configuration or module issue, so then your website should be debugged to find the reason.

GBain22’s picture

Ive cleared the cache, no difference and tried the templating rescan, which made no difference - so im going to install a fresh drupal with CCK and Calendar and try rebuilding it to see if I can spot any differences. Thanks for the help, I'll report back as soon as possible.

kenorb’s picture

You can also make some debug tests.
In your theme dir in calendar-day.tpl.php file.
Find this lines:

      $hour_from = variable_get('booking_timeslot_hour_from', 8);
      $hour_to = variable_get('booking_timeslot_hour_to', 18);
      for ($h = $hour_from; $h<=$hour_to; $h++) {

And put before FOR instruction some debug to make sure that you have TPL correctly parsed.
So it should looks like:

      $hour_from = variable_get('booking_timeslot_hour_from', 8);
      $hour_to = variable_get('booking_timeslot_hour_to', 18);
var_dump($hour_from); exit;
      for ($h = $hour_from; $h<=$hour_to; $h++) {

If you will see white screen with your $hour_from settings, that's fine. If not, there could be some theme issues.
In case if you using different theme for admin, you have to place it there.
After the test, remove this lines that you added and tell me what was the result.

GBain22’s picture

After adding in the extra line into the tpl file I got this:

string(1) "8"
Items
All day

Which I presume is what was expected. I notice now that my bookings are fine on the day view if 10am onwards - (whereas I initially thought it was 10am-4pm). So its just bookings at 8am and 9am that don't seem to come through.

If I click "Book now" on the specific slot - then the CCK date field that Im using is populated with that current date and time (which is great) but this does not happen when you click on a slot in 8am or 9am - so its just these 2 time slots that are the problem.

Cheers.

kenorb’s picture

Category: support » bug

I think I know what you mean, I thought that your list on day view can't start before 10AM and you have seen the old list.
But I've checked your screenshot and you have 9AM in your view.
Sorry for so long time to understand your problem.
Yes, so definitely there is some problem with parsing one-digit hours.
I'll make some tests.

kenorb’s picture

Quick-fix:
In file booking_timeslots.inc in booking_timeslots_valid_datetime()
please replace return line with following:

  return preg_match("/^([0-9]{2,4})-([0-1]?[0-9])-([0-3]?[0-9]) (?:([0-2]?[0-9]):([0-5][0-9]):([0-5][0-9]))?$/", $datetime);

Added question mark after [0-2]

It should solve the problem.
It was because this regex couldn't understand datetime with one digit like: 'node/add/%/2009-06-30 9:00:00' instead of 'node/add/%/2009-06-30 09:00:00'.

kenorb’s picture

Status: Active » Needs review

Commited.
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/booking_tim...

You can also download the fresh version of booking_timeslots.inc file
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/booking_tim...
and replace it.
Change should be visible immediately.

GBain22’s picture

My appointments still aren't showing at 8am or 9am, im just going to clear cache and reinstall the module etc to ensure these are the issue.

EDIT: yeah the problem is still remaining for me - just not able to get the slots to be taken up at 8am or 9am - the change you made before made it possible that the date is auto selected when I try to make a booking, but it has still not solved the issue of not being able to see the appointment that is made on the day view.

GBain22’s picture

Is it worth me trying this on a brand new install of Drupal? Or can you see where the problem may be?

Cheers.

kenorb’s picture

No, you don't need to install it on fresh, just tell me on which stage of booking you have problem and what's wrong.
You can't see booked dates on day view, is that is wrong or something else?

GBain22’s picture

Nope thats right, simply just 8am and 9am bookings that I can't see on day-view only. Thanks very much for this help by the way.

kenorb’s picture

There could be issue somewhere inside for() loop in calendar-day.tpl.php
I can't test it now and I don't know if I could do that today (I've got some problems with my website as well, it's crashing all the time), but temporary the quick-fix could be after this line:

        for ($half = 0; $half<= (int)($view->style_options['groupby_times'] === 'half'); $half++) { // half-hour style supported if enabled

You can try to add additional condition after above line:

          if (strlen($h) == 1) {
            $h = '0' . $h;
          }

So one-digit hour will be converted into two-digits.

GBain22’s picture

Status: Needs review » Fixed

Excellent, thats worked for me now - thanks for all your help.

kenorb’s picture

Status: Fixed » Needs work

Not a problem.
I'll test it on my website and I'll commit it soon.

kenorb’s picture

Status: Needs work » Fixed

Fixed.
http://drupal.org/cvs?commit=220294

And fixed one more bug, when you have hour view (instead of half-hour), then slot is doubled.
Please update it to latest dev.

Status: Fixed » Closed (fixed)

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

tanvivohra’s picture

Title: Bookings before 10 and after 5 not showing on Calendar » Need Help creating users personal calender
Category: bug » support
Priority: Normal » Critical
Status: Closed (fixed) » Active

Hey I am new to drupal. I am working on creation of a website that requires me to have personal calendar of each user.
There are two types of users one to take appointment(requester) with the other(reviewer). But both needs to have their own calendar.
So each reviewer would first set up their calendar specifying the time slots they will be free for say a week. The requester can go to each reviewer's page and book any available time slot which now shud appear as booked for others.

Is all this possible...? If yes can someone help??

kenorb’s picture

Title: Need Help creating users personal calender » Bookings before 10 and after 5 not showing on Calendar
Component: User interface » booking_timeslots
Category: support » bug
Priority: Critical » Normal
Status: Active » Closed (fixed)

Please don't hijack not related issues.
Please raise the new ticket.