Closed (fixed)
Project:
Booking Time Slots
Version:
6.x-1.0
Component:
booking_timeslots
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2009 at 08:59 UTC
Updated:
1 Jul 2011 at 22:45 UTC
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
Comment #1
kenorb commentedThanks 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.
Comment #2
GBain22 commentedI 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.
Comment #3
GBain22 commentedI apologise, this is for version 6.x1.0 and not the drupal 5 version. Was there a "fix" for this released?
Comment #4
kenorb commentedNo, please download and try development version.
In 1.0 this functionality was not included. It will be in next release version.
Comment #5
GBain22 commentedHi,
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.
Comment #6
kenorb commentedDid you copied already new version of calendar-day.tpl.php file into your theme folder and Cleared the cache?
Comment #7
GBain22 commentedI 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
Comment #8
kenorb commentedNow 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?
Comment #9
GBain22 commentedbooking_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.
Comment #10
kenorb commentedFrom 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:
I'm not sure, but it could cause some unexpected behaviour.
And tell me if that worked for you.
Comment #11
GBain22 commentedI 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
Comment #12
kenorb commentedYes, 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:
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.
Comment #13
GBain22 commentedIve 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.
Comment #14
kenorb commentedYou can also make some debug tests.
In your theme dir in calendar-day.tpl.php file.
Find this lines:
And put before FOR instruction some debug to make sure that you have TPL correctly parsed.
So it should looks like:
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.
Comment #15
GBain22 commentedAfter 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.
Comment #16
kenorb commentedI 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.
Comment #17
kenorb commentedQuick-fix:
In file booking_timeslots.inc in booking_timeslots_valid_datetime()
please replace return line with following:
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'.
Comment #18
kenorb commentedCommited.
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.
Comment #19
GBain22 commentedMy 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.
Comment #20
GBain22 commentedIs it worth me trying this on a brand new install of Drupal? Or can you see where the problem may be?
Cheers.
Comment #21
kenorb commentedNo, 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?
Comment #22
GBain22 commentedNope 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.
Comment #23
kenorb commentedThere 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:
You can try to add additional condition after above line:
So one-digit hour will be converted into two-digits.
Comment #24
GBain22 commentedExcellent, thats worked for me now - thanks for all your help.
Comment #25
kenorb commentedNot a problem.
I'll test it on my website and I'll commit it soon.
Comment #26
kenorb commentedFixed.
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.
Comment #28
tanvivohra commentedHey 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??
Comment #29
kenorb commentedPlease don't hijack not related issues.
Please raise the new ticket.