I should have explained it better.
The draw_cal() function is a php function and is the center part of the calendar script.
It can be found in ac-includes/functions.inc.php
You basically need to modify the mysql query so that it uses the id_ref_external field
So this:
- Code: Select all
$sql = "
SELECT
t1.the_date,
t2.class,
t2.desc_".LANG." AS the_state
FROM
".T_BOOKINGS." AS t1
LEFT JOIN ".T_BOOKING_STATES." AS t2 ON t2.id=t1.id_state
WHERE
t1.id_item=".$id_item."
AND MONTH(t1.the_date)=".$month."
AND YEAR(t1.the_date)=".$year."
";
becomes this:
- Code: Select all
$sql = "
SELECT
t1.the_date,
t2.class,
t2.desc_".LANG." AS the_state
FROM
".T_BOOKINGS." AS t1
LEFT JOIN ".T_BOOKING_STATES." AS t2 ON t2.id=t1.id_state
WHERE
t1.id_ref_external=".$id_item."
AND MONTH(t1.the_date)=".$month."
AND YEAR(t1.the_date)=".$year."
";
However, bear in mind that this function is also used by the admin panel so you will also need to modify the ac-admin/bookings.admin.php file so that it also passes this id_ref_external value as oposed to the default "id" field.
I'll let you take a look at that otherwise I will try to outline the changes required tomorrow (it is close to midnight here)
Chris