Hi,
I would to know if there is a possibility to move all events between 2 dates with a numbers of days. In my case, I have hundreds of events between the 06/02/2011 until the 06/25/2011 (for a trip). If I add activities on the 06/18/2010, The events after this date have to be moved of +1 day. Because now, I have to move manualy all events, and it takes lots of time 
The best way for me would be 3 inputs:
From day “A” to day “B”-> move of “X” days.
Thanks
You can add the next piece of code and trigger it when necessary
var events = scheduler.getEvents(new Date(2011,5,2), new Date(2011,5,25));
for (var i=0; i<events.length; i++){
var ev = scheduler.getEvent([events[i]);
ev.start_date = scheduler.date.add(ev.start_date, 2 , "day");
ev.end_date = scheduler.date.add(ev.end_date, 2 , "day");
dp.setUpdated(ev.id, true, "updated"); //save changes to DB
}
Thanks Stanislav,
I tried this piece of code with including a button (wich call this function) on the top of the scheduler and added an alert to check if my function is correctly called but nothing happened exept my alert. Does I have to change anything else into your code?
Here is the line of the button:
<A HREF=\"#\" onClick=\"dep()\">Clic</A>
In the js:
[code]function dep() {
var events = scheduler.getEvents(new Date(2011,3,18), new Date(2011,4,21));
for (var i=0; i<events.length; i++){
var ev = scheduler.getEvent(events[i]);
alert (‘déplacé!’)
ev.start_date = scheduler.date.add(ev.start_date, 2 , “day”);
ev.end_date = scheduler.date.add(ev.end_date, 2 , “day”);
dp.setUpdated(ev.id, true, “updated”); //save changes to DB
}
}[/code]
PS: I corrected
([events[i])
=>
(events[i])
I don’t understand all of this code (the parts with "day and “updated”), maybe I missed something?
Check the attached sample.
1280220894.zip (47.9 KB)
The code works fine with xml but not with sql DB:
With this code:
function mmove(){
var events = scheduler.getEvents(new Date(2010,1,1), new Date(2010,1,28));
for (var i=0; i<events.length; i++){
var ev = scheduler.getEvent(events[i].id);
ev.start_date = scheduler.date.add(ev.start_date, 2 , "day");
ev.end_date = scheduler.date.add(ev.end_date, 2 , "day");
//dp.setUpdated(ev.id, true, "updated"); //save changes to DB
}
scheduler.setCurrentView(scheduler._date); //refresh self
}
I can see events moving of 2 days and they’re not saved in DB (that’s normal)
If I remove the “//” before “dp.setUpdated […]”, nothing happened on scheduler and on DB.
Maybe an idea? (I’m working on joomla!)
Thank you!
You have dataprocessor initialization similar to samples/01_initialization_loading/05_loading_mysql.html , right?
No I don’t,
Part of \components\com_scheduler\codebase\dhtmlxSchedulerConfigurator.php (on my local server, with joomla!):
$scheduler .= "
scheduler.init(\"scheduler_here\",new Date(2011,5,1),\"".$defaultmode."\"); scheduler.load(\"".$url."dhtmlxSchedulerConfiguratorLoad.php?scheduler_events=trueevents_rec=true&uid=\"+scheduler.uid());
var dp = new dataProcessor(\"".$url."dhtmlxSchedulerConfiguratorLoad.php?scheduler_events=true\");
dp.init(scheduler);";
Part of samples/01_initialization_loading/05_loading_mysql.html (That I don’t use):
function init() {
[...]
scheduler.init('scheduler_here',new Date(2009,10,1),"month");
scheduler.setLoadMode("month")
scheduler.load("php/events.php");
var dp = new dataProcessor("php/events.php");
dp.init(scheduler);
}
I don’t know exactly how the events are saved on DB but I know that this code
dp.setUpdated(id,true,"updated");
is in dhtmlxscheduler.js and looks like as the code you wrote before
dp.setUpdated(ev.id, true, "updated");
(except ev.id?)
did I answered correctly to your questions?
If you are using plugin, then things may be a bit more messy, because initialization code is dynamic, but still, somewhere inside, initialization of dataprocessor occurs.
uncommenting
dp.setUpdated(ev.id, true, “updated”);
must work for your case.
a) be sure that current joomla user has rights on data modifications
b) if issue still occurs - you can try to replace dhtmlxscheduler.js with the attached file ( it must provide debug console for all db saving operations )
dhtmlxscheduler_debug.zip (30.9 KB)
a) I’m sure that I have admin rights
b) Even changing by this new js, nothing else happens. When I click on the move button, nothing is writen into the debug console (behind “log”) ?!
Forget it if it’s impossible. It’s a pity!
It would be a great implementation for the next release for Joomla. I’m sure I’m not alone to need it 
I’ll try to do it by php/sql request but I have to made it from 0 and it will not be easy.
thanks