Thanks a lot for your precious advice . Thanks to that, I was able to successfully add the value of my field to the event object. However, now I have trouble figuring out if I correctly connected my function to the AfterProcessing event (well okay, I obviously did something wrong since otherwise I wouldn’t be asking he he he). Here’s what I did:
<?php
require_once('js/scheduler/codebase/connector/scheduler_connector.php');
//require_once('js/scheduler/codebase/connector/crosslink_connector.php');
include ('include/connect.php');
function insertCC($action)
{
//if ($action->get_status() == "update")
//{
$requete = "INSERT INTO tblpmcc (TodoId, NoPersonne) values(" . $action->get_id() . ", " . $action->get_value('lstCC1') . ")";
mysql_query($requete) or die(mysql_error());
//}
}
//include ('../../common/config.php');
//$res=mysql_connect($server, $user, $pass);
//$res=mysql_connect("localhost", "root", "flex2010");
//mysql_select_db("flexgroup");
$sqlEmployes = "SELECT NoPersonne as value, NomPersonne as label FROM tblcartetempspersonnes where Statut = 1 order by NomPersonne asc";
$sqlClients = "SELECT NoClient as value, NomClient as label FROM tblcartetempsclients where Statut = 1 order by NomClient asc";
$sqlDivisions = "select 0 as value, '' as label from tblcartetempsdivisions where 1 union SELECT NoDivision as value, NomDivision as label FROM tblcartetempsdivisions order by label asc";
//$cross = new CrossOptionsConnector($conn);
$scheduler = new schedulerConnector($conn);
$listeEmployes = new OptionsConnector($conn);
$listeClients = new OptionsConnector($conn);
$listeDivisions = new OptionsConnector($conn);
$listeEmployes->render_sql($sqlEmployes, "NoPersonne", "NoPersonne(value),NomPersonne(label)");
$listeClients->render_sql($sqlClients, "NoClient", "NoClient(value), NomClient(label)");
$listeDivisions->render_sql($sqlDivisions, "NoDivision", "NoDivision(value), NomDivision(label)");
//$cross->options->render_sql($sqlEmployes,"NoPersonne","NoPersonne(value),NomPersonne(label)");
//$cross->link->render_table("tblpmcc","TodoId", "NoPersonne,TodoId");
$scheduler->set_encoding("iso-8859-1");
$scheduler->enable_log("log.txt",true);
$scheduler->set_options("listeEmployes", $listeEmployes);
$scheduler->set_options("listeClients", $listeClients);
$scheduler->set_options("listeDivisions", $listeDivisions);
//$scheduler->set_options("listeCC", $cross->options);
$scheduler->render_table("tblpmtodo","TodoId",
"StartDateTime,EndDateTime,Etiquette,Description,Notes,ANoPersonne,Reminder,ADroitPersonne,ReminderDateTime,DeNoPersonne,NoClient,NoDivision,PrcComplete,Priorite,CalendrierStrategique");
$scheduler->event->attach("afterProcessing", "insertCC");
?>
I activated the log in the hope that I would be able to discern what went wrong, but there’s absolutely no trace of it even trying to touch my tblpmcc table:
====================================
Log started, 08/11/2010 09:11:20
====================================
DataProcessor object initialized
23_id => 23
23_start_date => 2010-10-27 12:40
23_end_date => 2010-10-27 12:45
23_text => TODO - 1288970160373
23_Description => ggghg
23_Notes => ghghghggh
23_ANoPersonne => 5
23_Reminder => 1
23_ADroitPersonne => 3
23_ReminderDateTime => 1899-11-30 00:00
23_DeNoPersonne => 64
23_NoClient => 53
23_NoDivision =>
23_PrcComplete => 0
23_Priorite => 1
23_CalendrierStrategique => 0
23_lstCC1 => 64
23_!nativeeditor_status => updated
ids => 23
Row data [23]
TodoId => 23
StartDateTime => 2010-10-27 12:40
EndDateTime => 2010-10-27 12:45
Etiquette => TODO - 1288970160373
Description => ggghg
Notes => ghghghggh
ANoPersonne => 5
Reminder => 1
ADroitPersonne => 3
ReminderDateTime => 1899-11-30 00:00
DeNoPersonne => 64
NoClient => 53
NoDivision =>
PrcComplete => 0
Priorite => 1
CalendrierStrategique => 0
lstCC1 => 64
!nativeeditor_status => updated
UPDATE tblpmtodo SET StartDateTime='2010-10-27 12:40',EndDateTime='2010-10-27 12:45',Etiquette='TODO - 1288970160373',Description='ggghg',Notes='ghghghggh',ANoPersonne='5',Reminder='1',ADroitPersonne='3',ReminderDateTime='1899-11-30 00:00',DeNoPersonne='64',NoClient='53',NoDivision='',PrcComplete='0',Priorite='1',CalendrierStrategique='0' WHERE TodoId='23'
Edit operation finished
0 => action:updated; sid:23; tid:23;
Done in 0.013406038284302s
There is however the lstCC1 property appearing which at least confirms that I was successful in adding the property correctly. However, I’m curious as to why nothing’s happening in tblpmcc. The worst part is that there’s no way for me to tell whether my function was actually called or not.
Anyway, any help would be greatly appreciated. Thanks in advance .
Osu