Hello,
I have be working with the Scheduler and come across some difficulties.
Basically, I am trying to get the data (start and end date) of the first occurrence in a Recurring event. I have tried using the Helper class and have not succeeded.
Could anyone please advise me how to sort this out?
Polina
August 25, 2017, 3:44pm
#2
Hello,
Please specify how you tried to get dates of event.
You can get required event object by getEvent method and its dates. For example:
docs.dhtmlx.com/scheduler/snippet/094ed2da
densman
August 27, 2017, 10:03pm
#3
Hi Polina,
Thanks for your response.
I am using the PHP Scheduler Helper Class.
require_once "./SchedulerHelper.php";
use DHTMLX_Scheduler\Helper;
$helper = new Helper(
array(
"dbsm" => "mysql", // optional, "mysql" by default
"host" => "localhost", // optional, "localhost" by default
"db_name" => "oilexvsl5",
"user" => "oilexvsluser_co",
"password" => "*****",
"table_name" => "tasks" // name of the table that contains data of recurring events
)
);
$helper->setFieldsNames(array(helper::FLD_ID => "id",));
$data = $helper->getData("2017-07-02 00:00:00", "2018-07-01 00:00:00");
var_dump($data);
This returns a blank screen. But the
$helper->deleteById(32950)
correctly deletes the event.
My plan is to get the recurrent events then retrieve the next event in the series and display it as the next event date.
I have attached my DB design.
densman
August 27, 2017, 10:35pm
#4
Here is an error log i get when i run this
$helper->getData("2017-07-02 00:00", "2018-07-01 00:00");
[27-Aug-2017 18:28:22 America/New_York] PHP Notice: Undefined offset: 1 in /home/oilexvsl/public_html/includes/SchedulerHelper.php on line 394
[27-Aug-2017 18:28:22 America/New_York] PHP Notice: Undefined offset: 4 in /home/oilexvsl/public_html/includes/RecurringType.php on line 189
[27-Aug-2017 18:28:22 America/New_York] PHP Notice: Undefined offset: 3 in /home/oilexvsl/public_html/includes/RecurringType.php on line 189
[27-Aug-2017 18:28:22 America/New_York] PHP Notice: Undefined offset: 2 in /home/oilexvsl/public_html/includes/RecurringType.php on line 189
[27-Aug-2017 18:28:22 America/New_York] PHP Notice: Undefined offset: 1 in /home/oilexvsl/public_html/includes/RecurringType.php on line 189
[27-Aug-2017 18:28:22 America/New_York] PHP Fatal error: Uncaught exception ‘Exception’ with message ‘Field ‘count’ not found.’ in /home/oilexvsl/public_html/includes/RecurringType.php:65
Stack trace:
#0 /home/oilexvsl/public_html/includes/RecurringType.php(215): DHTMLX_Scheduler\RecurringType->_getFieldValue(‘count’)
#1 /home/oilexvsl/public_html/includes/RecurringType.php(395): DHTMLX_Scheduler\RecurringType->getRecurringTypeStepValue()
#2 /home/oilexvsl/public_html/includes/SchedulerHelper.php(404): DHTMLX_Scheduler\RecurringType->getRecurringDates(1498968000, 1530417600)
#3 /home/oilexvsl/public_html/includes/test-rec.php(18): DHTMLX_Scheduler\Helper->getData(‘2017-07-02 00:0…’, ‘2018-07-01 00:0…’)
#4 {main}
thrown in /home/oilexvsl/public_html/includes/RecurringType.php on line 65
Polina
August 28, 2017, 12:01pm
#5
Hi,
Recurring events are saved in db like one event and displayed in Scheduler like recurring one according to ‘rec_type’ value. So you can’t get every recurrent event of the series from db.