Active
Project:
Booking Time Slots
Version:
7.x-1.x-dev
Component:
booking_timeslots
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2011 at 13:58 UTC
Updated:
29 Sep 2015 at 14:54 UTC
Jump to comment: Most recent
Comments
Comment #1
kenorb commentedYou can change the name of template file.
Go to your calendar view, Day display and click on: Theme Information
You'll see available template names.
If your calendar view name is: booking_calendar
Copy/rename calendar-day.tpl.php to calendar-day--booking-calendar.tpl.php, etc.
Comment #2
kenorb commentedComment #3
emi_bcn commentedHi again,
Same error at 7 version (from GitHub), but the workaround renaming template files does not work. Maybe adding a Booking TS admin setting for enabling/disabling?
Thanks!
Comment #4
kenorb commentedComment #5
emi_bcn commentedHello again,
I've managed to use templated files only for the booking view, naming the templates to calendar-day--bt-schedule.tpl.php and similars. But still some errors when viewing the other calendar (not the booking one):
Also, in this calendar appears the filters from Booking TS, and finally no days visible (the page ends just after the filters section).
Thanks a lot,
emi
Comment #6
kenorb commented@emi_bcn The path to templates/ is overriden in booking_timeslots_theme_registry_alter()
So you can either place your file as suggested by the error, or if you want to use theme folder, probably you can, but I'm not sure why it's failing.
Comment #7
emi_bcn commentedHi again,
I think the problem is that the other calendar (the one not associated with booking) is trying to use the booking templates.
I've managed to make it work linking original templates from Calendar module directly to booking module:
ln -s ../../calendar/theme/calendar-{day,week,month}.tpl.php .But still showing booking filters on non-booking calendar. And there is a critical error when viewing non-booking day-view calendar, which comes from SQL at booking_timeslots_get_daily_settings() :
Which is trying to use calendar argument (day: '2015-04-17') as a nid for primary_id. I suppose many errors will disappear when deactivating booking module for non-booking calendars (I don't know at all how it can be done, yet).
Thanks,
emi
Comment #8
kenorb commented@emi_bcn
You can temporary comment out 'preprocess functions' lines in booking_timeslots_theme_registry_alter() [file: booking_timeslots.module], either all or for specific calendar view (either day or month), then probably clear cache is needed. Then see if that works, but probably the booking calendar it-self will stop working.
Or maybe better way, comment out template_preprocess_booking_timeslots_month_overlap() in template_preprocess_booking_timeslots_month() and see if that would work.
I think we probably need to do some extra conditions in template_preprocess_booking_timeslots_month() or in template_preprocess_booking_timeslots_month_overlap() [in booking_timeslots.theme.inc file] to make sure (but checking somewhere in $vars['view']) if we're dealing with our booking view. Just a guess looking at the code.
Comment #9
emi_bcn commentedHi again,
I've managed to disable BTS on non-BTS enabled calendars. I've just added an initial condition to:
The condition I've just added is for testing, but it works (my BTS enabled view is the one with $vid = 31):
I think it's a good idea to add a multiselect list option (checkbox) to BTS admin page, where one can select the BTS enabled calendar views (the list must be done only with calendar enabled views). Then, use a helper function with $vid as a parameter and the enabled BTS calendar views as a static/cached variable on these 4 functions I've posted on the example.
Do you think it's a good idea? If so, do you want me to do a patch for it?
Thanks a lot. See you soon,
emi
Comment #10
emi_bcn commentedHi again,
I've found that modifying booking_timeslots.module: booking_timeslots_form_views_exposed_form_alter is enough, and no template preprocess function modifications is needed. So, the only additions are the admin option and the condition in booking_timeslots_form_views_exposed_form_alter . And add the instructions for TPL renaming and linking (or another solution suggested?):
Comment #11
kenorb commented@emi_bcn Yes, add patch file whenever you can or include lines to change, so
vid == 31needs to be translated into non-hardcoded condition. Unfortunately I won't have time to fix it.Yes, I think it would be a good idea to rename the templates for more specific conventions.