probleme with map_to:"auto"

Hi

I have a problem using dhtmlxScheduller with Dataprocessor and PHP/MySQL
This is the structure of my details form

scheduler.config.lightbox.sections = [

{ name:"patient", options:snacks, map_to:"ag_detail", type:"combo", image_path: "./codebase/imgs/", filtering: true},
{ name:"description", height:50, map_to:"ag_patient", type:"textarea", focus:true },
{ name:"time", height:72, type:"time", map_to:"auto"},

];

In the server side i have this mapping

$connector->render_table(“agenda”,“ag_id”,“ag_dateDebut,ag_dateFin,ag_patient,ag_detail”);

The problem is the fact that when I am creating a new event in the Scheduller and save it,
in my database the begining and end date are 0000-00-00 00:00:00 I don’t Knwo why

Best Regards

Hello,

Please uncomment logging function in connector file (events.php) and check what log says.

Kind regards,
Ilya

the begining and end date are 0000-00-00 00:00:00

Which value you have for scheduler.config.xml_date ? By default it is “%m/%d/%Y %H:%i”, which must be equal to date format supported by database.

Hi
this is the format that i have define for the date according to my data base
scheduler.config.xml_date = “%Y-%m-%d %H:%i:%s”; I hope it is OK
but i still have the same problem It is why i would like to Knwo if
this configuration looks good

scheduler.config.lightbox.sections = [

{ name:"patient", options:patients, map_to:"ag_patient", type:"combo", image_path: "./codebase/imgs/", filtering: true},
{ name:"description", height:50, map_to:"ag_detail", type:"textarea", focus:true },
{ name:"time", height:72, type:"time", map_to:"auto"},

];

The question is how to map the time section with the field ag_dateDebut(Begining date ) and ag_dateFin (End Date) in my data base? I am not shure that map_to:“auto” will do it automatically

Please uncomment logging function in connector file (events.php) and check what log says.

I am affraid that I don’t Knwo where I can reach this “events.php” file to uncomment logging function.

Best Regards
Mbello

Hello,

How do you fetch your events from the DB?

Kind regards,
Ilya

Hi
I use a data processor and connector to fetch event from my data base like this :

        require("codebase/connector/scheduler_connector.php");
	require("codebase/connector/db_mysqli.php");
	
	$res = new mysqli(HOST, USER, PASSWORD, DATABASE); 
	//liaison entre le scheduller et le dataprocessor a travers le connector 
	$connector = new SchedulerConnector($res,"MySQLi");
	//mappage du connector avec la table agenda et ses champs.
	$connector->render_table("agenda","ag_id","ag_dateDebut,ag_dateFin,ag_patient,ag_detail");
    $connector->set_encoding("UTF-8");	

Best regards
mbello

Change code as

$connector = new SchedulerConnector($res,“MySQLi”);
$connector->enable_log("./some.txt", true);

now scheduler will save all errors and all sql queries in some.txt

Hi
this is an example of my log file

As you can see date format is not as I want : ‘04/10/2012 12:45’
I want this format “%Y-%m-%d %H:%i:%s” and I use this configuration :

scheduler.config.xml_date = "%Y-%m-%d %H:%i:%s"; scheduler.config.api_date = "%Y-%m-%d %H:%i:%s";

But It doesn’t work ! How can I specified the right format according to my MySQL data base ?

Best Regards
Mbello

scheduler.config.xml_date = "%Y-%m-%d %H:%i:%s"; scheduler.config.api_date = "%Y-%m-%d %H:%i:%s";

Please be sure that above lines placed before scheduler.init ( if they are placed after init call - they will not be applied correctly )

Hi
It ok now for the problem of date format
but I have 2 another problem :
in this section : { name:"patient", options:patients, map_to:"ag_patient", type:"combo", image_path: "./codebase/imgs/", filtering: true, focus:true},

  • How can I refer to my combo in order to for exemple define it readonly
  • The anoter problem is the fact that the options of my combo have this structure

        { key: 5, label: 'Pineapple' },
	{ key: 6, label: 'Chocolate' },
	{ key: 7, label: 'Chips' },
	{ key: 8, label: 'Apple pie' }

When I selected Pineapple for exemple key 5 is saved in my Data Base this sound OK but when I relaod my sheduler in my browser I have Key 5 displayed. I would like to display Pineapple as I Choose Is it possible ? if yes How ?

Best Regards
Mbello