Hi there,
Here's the problem I have. On the scheduler, I would like to implement some measure of access privileges on a "per-event" basis. Basically, what I want to do is allow only the person who created the event to delete it. Others should only be able to see the information in readonly mode.
My first step to accomplish this was to try and keep the toolbar appearing on the left of an event from appearing if the user doesn’t have the proper privileges and clicks on said event. The thing is that when I redefine the onClick event of an scheduler’s event, the bar on the left stops working completely. It shows up, but I can click on the icons all day and nothing’s happening. I’ve seen I can do something like:
scheduler.config.icons_select = [“icon_details”, “icon_delete”];
in order to control which buttons actually appear, but this is sort of a “general” measure for all events while I’m really going on a per-event basis. If worse comes to worst, I can always just hide every button except for the “icon_details” one, which I assume to be the lightbox opener and then do my security via the lightbox instead.
Anyway, if anyone could tell me if what I’m trying to do is feasible or not (and if it is, how of course). Here’s the code I have so far:
var eventSelected = "";
scheduler.attachEvent("onClick", function(event_id, event_object) {
if (getDroits(scheduler.getEvent(event_id), <?php echo $_SESSION['Employe']; ?>) != 1)
{
scheduler.unselect();
}
else
{
if (eventSelected != event_id)
{
scheduler.select(event_id);
eventSelected = event_id;
}
}
});
Also, I sort of understand why the buttons don’t work since I’m basically redefining the event that made them work in the first place. So in essence, all I would have to do is repeat what was originally done on the “onClick” event and put it after my verifications… I just don’t know what the original treatment was.
Anyway, thanks in advance.
Osu