I was able to get this working fairly quickly. Here are the changes that I made, in case anyone is interested:
In ac-admin/bookings.admin.php, I added a javascript function to change the selected click method depending on the number that is passed in.
- Code: Select all
$contents.='
<script type="text/javascript">
function changeClickMethod(num) {
document.booking_state_selector.id_predefined_state[num+1].selected = "1";
}
</script>
<form name="booking_state_selector">
...
I also changed $calendar_states to $calendar_states_admin, since I want to keep this change separate from the public view of the calendar.
- Code: Select all
<div id="key_wrapper">
'.$calendar_states_admin.'
</div>
In ac-includes/cal.inc.php, I added the onClick event handler to each list item. I only want to do this in the admin interface, that's why I am storing this in $list_states_admin which I created
- Code: Select all
$sql="SELECT id,class,desc_".LANG." AS the_desc FROM ".T_BOOKING_STATES." WHERE state=1 ORDER BY list_order ASC";
$res=mysql_query($sql) or die("Error getting states");
$rownum=0;
while($row=mysql_fetch_assoc($res)){
$list_states_admin.='<li class="'.$row["class"].' selectable" title="'.$row["the_desc"].'"
onClick="changeClickMethod(' . $rownum++ . ')">
<span>'.$row["the_desc"].'</span></li>
';
$sel_list_states.='<option value="'.$row["id"].'">'.$row["the_desc"].'</option>';
}
...
$calendar_states_admin='
<div id="key" class="cal_month">
<div class="cal_title">'.$lang["legend"].'</div>
<ul>
'.$list_states_admin.'
</ul>
</div>
';
?>
In ac-admin/css/admin-calendar.css:
- Code: Select all
.selectable {
cursor: pointer;
}