Scheduler and DataProzessor

Short question, because i used about a day to find a clean way and had no success:

I am trying to create a multi-user scheduler environment (yes, i got a pro license :smiley: ), where different users got their very own scheduler and of course only THEIR events. I have to do this, with adding an unique “client_id” into the EVENTS table in the database.

So my init is like this:

[code] scheduler.setLoadMode(“year”)
scheduler.load(“inc/events.php”);

	var dp = new dataProcessor("inc/events.php");
	dp.init(scheduler);	[/code]

events.php:

$client_id = "test"; $scheduler->render_sql("select * from events where client_id='".$client_id."'", "event_id", "start_date,end_date,text,nachname,........,user");

The proeccsing of data works perfect, but when adding a NEW EVENT, the database-field for “client_id” stays empty (and so, after a reload, the event of course doesn’t appear in the scheduler :slight_smile: ).

In other words: How can i add a value-pair through the processor without adding a hidden-field to the edior that holds the client_id? :neutral_face:
From my point of view it would be totally okay, if i could hardcode it anywhere into the database-connection, but no idea where this could be :[

Best wishes from .de,
Ben

Hi,
since the ID of current user is known on server, you can add it into the record before inserting it to the db
Code might look following:[code]function addUserId($action){
$user_id = getUserIdSomehow();
$action->set_value(“user_id”,$user_id);
}

$connector->event->attach(“beforeInsert”,“addUserId”);[/code]
docs.dhtmlx.com/connector__php__ … event.html

This works absolutely perfect.
I am sorry for not getting this running, because i found this event, worked with it, and passed it away for not working :slight_smile:

Thank you so much, i hope i can now finish my production without getting on you guys nerves.