Hello there, I seem to be having a bit of trouble with the multiselect control. I can get the list of checkboxes to show up correctly… but I can click on them all I want, it doesn’t do anything in the database when I save. Essentially, I have three tables organized like this:
tblEmployees -------> tblpmcc <--------------------- tblpmtodo
Server-side, here’s what I’m doing:
require_once('js/scheduler/codebase/connector/scheduler_connector.php');
require_once('js/scheduler/codebase/connector/crosslink_connector.php');
include ('include/connect.php');
//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","CCId", "CCNoPersonne,TodoId2");
$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,ANoPersonne,DeNoPersonne,NoClient,NoDivision");
And, of course, client-side, here’s what I’m doing:
<script type="text/javascript" charset="utf-8">
function init() {
var sections = scheduler.serverList("listeEmployes");
/*var sections=[
{key:64, label:"Tobbi Filteau"},
{key:69, label:"Étienne Gamache"}
//{key:3, label:"Section C"},
//{key:4, label:"Section D"}
];*/
scheduler.locale.labels.employe_tab = "Employés";
scheduler.locale.labels.day_tab = "Jour";
scheduler.locale.labels.week_tab = "Semaine";
scheduler.locale.labels.month_tab = "Mois";
scheduler.locale.labels.today_button = "Aujourd'hui";
scheduler.locale.labels.section_empDest="À";
scheduler.locale.labels.section_empOrigine="De";
scheduler.locale.labels.section_empCC="CC";
scheduler.locale.labels.section_Client="Client";
scheduler.locale.labels.section_Division="Division";
scheduler.locale.labels.section_time="Durée";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.prevent_cache = true;
scheduler.config.first_hour=8;
//scheduler.locale.labels.section_type = "Personne";
//
scheduler.config.lightbox.sections=[
{name:"description", height:72, map_to:"Description", type:"textarea" , focus:true},
//{name:"etiquette", height:43, type:"textarea", map_to:"Etiquette"},
{name:"empDest", height:21, type:"select", map_to:"ANoPersonne", options:scheduler.serverList("listeEmployes")},
{name:"empOrigine", height:21, type:"select", map_to:"DeNoPersonne", options:scheduler.serverList("listeEmployes")},
{name:"empCC", height:72, type:"multiselect", map_to:"TodoId2", options:scheduler.serverList("listeCC"), script_url:"calendrierConnecteur.php", vertical:"false"},
{name:"Client", height:21, type:"select", map_to:"NoClient", options:scheduler.serverList("listeClients")},
{name:"Division", height:21, type:"select", map_to:"NoDivision", options:scheduler.serverList("listeDivisions")},
{name:"time", height:72, type:"time", map_to:"auto"}
]
scheduler.createUnitsView({
name:"employe",
property:"ANoPersonne",
list:sections
});
//scheduler.locale.labels.section_personne="Personne";
//scheduler.locale.labels.section_etiquette="Titre";
//scheduler.config.details_on_create=true;
//scheduler.config.details_on_dblclick=true;
scheduler.config.multi_day = true;
scheduler.init('scheduler_here',new Date(2010,09,27),"employe");
//scheduler.setLoadMode("month")
scheduler.load("calendrierConnecteur.php");
var dp = new dataProcessor("calendrierConnecteur.php");
dp.enableUTFencoding(false);
dp.init(scheduler);
}
</script>
Can anyone tell me what’s wrong? Unless I misunderstood the purpose of the CrossOptionsConnector, I would have expected some lines to appear in tblpmcc if I check one of the options shown by my multiselect control, but right now it stays hopelessly blank.
Thanks in advance