Scheduler problem with Internet explorer 8

Hi!
I have a problem with Internet explorer 8, my scheduler in Firefox and Safari works right, but on Internet Explorer 8 appears the loading and don’t load the scheduler. This is my code:

<script type="text/javascript">

	scheduler.locale.labels.unit_tab = "<?= __('Employers') ?>";

	scheduler.config.details_on_dblclick=true;
	scheduler.config.dblclick_create = false;

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

	var prioritats=[
		{key:0, label:"<?= __('-- Select priority') ?>"},
		{key:1, label:"<?= __('Low') ?>"},
		{key:2, label:"<?= __('Medium') ?>"},
		{key:3, label:"<?= __('Hight') ?>"},
	];

	scheduler.config.lightbox.sections=[
		{name:"description", height:130, map_to:"description", type:"textarea" , focus:true},
		{name:"priority", height:34, map_to:"priority", type:"select", options:prioritats},
		{name:"status", height:34, map_to:"status_id", type:"select", options:scheduler.serverList("estats")},
		{name:"employer", height:35, type:"select",options:scheduler.serverList("employers"), map_to:"employer_id" },
		{name:"contactname", height:21, map_to:"contact_name", type:"textarea"},
		{name:"contactphone", height:21, map_to:"contact_phone", type:"textarea"},
		{name:"contactemail", height:21, map_to:"contact_email", type:"textarea"},
		{name:"time", height:74, type:"time", map_to:"auto"}
	];

	scheduler.config.multi_day = true;

	scheduler.locale.labels.section_status="<?= __('Status') ?>";
	scheduler.locale.labels.section_employer="<?= __('Employer') ?>";
	scheduler.locale.labels.section_priority="<?= __('Priority') ?>";
	scheduler.locale.labels.section_contactname="<?= __('Contact Name') ?>";
	scheduler.locale.labels.section_contactphone="<?= __('Contact Phone') ?>";
	scheduler.locale.labels.section_contactemail="<?= __('Contact Email') ?>";

	scheduler.config.icons_select=["icon_details","icon_edit"];

	var add_event_btn = document.getElementById('add_event');
	add_event_btn.onclick = function() {
		window.location="<?= url_for('task/create') ?>";
	}

	scheduler.config.first_hour = 6;

	scheduler.config.show_loading = true;

	scheduler.templates.event_class=function(start,end,event){
    	switch(event.status_id){
          case "1" : return "todo";
          case "2" : return "inprogress";
          case "3" : return "reported";
          case "4" : return "closed";
    	}
	}

	scheduler.templates.event_bar_text=function(start,end,event){
           return "<span title='"+event.description+"'>"+event.text+"</span>";
	}

	scheduler.createUnitsView({
		name:"unit",
		property:"employer_id",
		list:scheduler.serverList("employers")
	});

	var fecha=new Date();
	scheduler.init('scheduler_here',new Date(fecha.getFullYear(),fecha.getMonth(),fecha.getDate()),"unit");
	scheduler.setLoadMode("month");
	scheduler.load("<?= url_for('calendar/seleccionarEvents') ?>");

	var dp = new dataProcessor("<?= url_for('calendar/seleccionarEvents') ?>");
	dp.init(scheduler);

</script>

What could be the problem?
Thanks!

  • Zaida -

Hello,

var prioritats=[ {key:0, label:"<?= __('-- Select priority') ?>"}, {key:1, label:"<?= __('Low') ?>"}, {key:2, label:"<?= __('Medium') ?>"}, {key:3, label:"<?= __('Hight') ?>"}, ];
Try deleting last comma, so you should get

var prioritats=[ {key:0, label:"<?= __('-- Select priority') ?>"}, {key:1, label:"<?= __('Low') ?>"}, {key:2, label:"<?= __('Medium') ?>"}, {key:3, label:"<?= __('Hight') ?>"} ];
Best regards,
Ilya

Hi Ilya,
I try with it and doesn’t work :frowning: Another solution?

Thanks a lot Ilya

  1. Are you using any plugin (wordpress, joomla)?
  2. What is exact error in IE (look for yellow triangle in the bottom left corner)?
  3. Try executing js code after page body was loaded:

[code]

[/code]

Best regards,
Ilya

  1. No, I’m using Symfony, but not any plugin.
  2. IE unfortunately don’t show any javascript error.The page load the tabs in the top of scheduler but dosn’t show me the days with the events, appears the loading but nothing more.
    3.I’ve trying with the event onLoad, but works like before :frowning:

I’ve seen that the first time the page works fine, but after if I refresh the page or what else, is when the error happens.

  • Zaida -

Sorry for my english! :blush:

  1. Press F12 in IE -> select Script tab -> click Start Debugging button, confirm it.
    Page should refresh itself and hopefully we will see line of code which triggers error.
  2. Please provide link to your website so we could check the issue.

Best regards,
Ilya

  1. I start the Debugging in the Script tab, and dosn’t show me any error!
  2. The web is not public, sorry :frowning: I’m writting a ticket to the technical support, I hope they help me too.

Best regards,

  • Zaida -

Is there other javascript code on the page?

I have tried using your js code (while removing everything i don’t have of course) and it works fine in IE8.
So let’s try to do the same, comment/edit several parts, check if page is loading correctly in IE. That way we will hopefully narrow it down who is a culprit.

var sections=[ {key:3, label:"Section B"}, {key:5, label:"Section C"}, {key:4, label:"Section D"}, {key:1, label:"Section A"} ]; scheduler.createUnitsView({ name:"unit", property:"employer_id", list: sections }); //list:scheduler.serverList("employers")
2. scheduler.load("../common/units.xml"); // grab it from the samples/common in the package /* scheduler.setLoadMode("month"); scheduler.load("<?= url_for('calendar/seleccionarEvents') ?>"); var dp = new dataProcessor("<?= url_for('calendar/seleccionarEvents') ?>"); dp.init(scheduler); */
3./* var add_event_btn = document.getElementById('add_event'); add_event_btn.onclick = function() { window.location="<?= url_for('task/create') ?>"; } */

Best regards,
Ilya

Hi!
Yes, there are others javascript files (prototype) in the page.

I’ve tried everything, when comment the code of second part (loading unit.xml),the scheduler shows in IE8 but the loading bar does not disappear :frowning:
The other codes (1 and 3) do not seem to affect the application operation in IE8.

This is the code for the calendar/seleccionarEvents:

$list_employers = new OptionsConnector($res);
$ids_employers = $this->getUser()->getExclusivitatEmployers();
$consulta_employers = "SELECT *,id as value,name as label FROM employer WHERE active=1";
if($ids_employers) $consulta_employers .= " AND id IN (".implode(",",$ids_employers).")";
$list_employers->render_sql($consulta_employers,"id","id(value),name(label)");

$list_status = new OptionsConnector($res);
$list_status->render_table("task_status","id","id(value),name(label)");

$scheduler = new schedulerConnector($res);
//$scheduler->enable_log("log.txt",true);
$scheduler->set_options("employers",$list_employers);
$scheduler->set_options("estats",$list_status);
//Security
$scheduler->access->deny("delete"); //blocks Delete action
$scheduler->set_encoding("iso-8859-1");
	//$scheduler->render_table("task","id","date,date_end,name,description,status_id,priority,contact_name,contact_phone,contact_email,employer_id");
//SQL CON exclusividad
$exclusivitat = implode(",",$this->getUser()->getExclusivitat());
$consulta_sql = "SELECT task.*,CONCAT('<img border=\"0\" style=\"margin-right:4px\" src=\"/images/backend/status',task.status_id,'.jpg\"><strong>[',UCASE(LEFT(employer.name,1)),UCASE(LEFT(employer.surname,1)),']</strong> ',task.name) as nom_mostrar FROM task,employer WHERE task.employer_id=employer.id AND task.active=1 AND (department_id IN (".$exclusivitat.") OR task.sf_guard_group_id IN (".$exclusivitat."))";
	$scheduler->render_sql($consulta_sql,"id","date,date_end,nom_mostrar,name,description,status_id,priority,contact_name,contact_phone,contact_email,employer_id");

I have another problem…before I loaded the events with a function render_table, and now with render_sql when I change the event in the scheduler, don’t save me the changes in database, when I used the render_table saved me the modifications successfully. What’s going wrong? :frowning:

Thanks, best regards

  • Zaida -

Hello,

Loading bar persists because IE has cached xml. First loading everything should work correctly.
Workaround:

scheduler.load("../common/units.xml?uid="+scheduler.uid());

Though it’s not the main issue :slight_smile:

At least now we know that something goes wrong then loading events.
Open your seleccionarEvents.php in the browser and attach results here.
Also enable log, also could help:

$scheduler->enable_log("log.txt",true);
$scheduler->render_sql($consulta_sql,"id","date,date_end,nom_mostrar,name,description,status_id,priority,contact_name,contact_phone,contact_email,employer_id");

I believe it should be:

$scheduler->render_sql($consulta_sql,"task.id","task.date,task.date_end,nom_mostrar,task.name,task.description,task.status_id,task.priority,task.contact_name,task.contact_phone,task.contact_email,task.employer_id");

Best regards,
Ilya

  1. I enable the log, and when executing the scheduler on Firefox the log saves successfully, but when I try with IE8,the log.txt is empty.
    I attached the results of seleccionarEvents, I hope it will be useful.
  2. If I put the fields with the table name, the scheduler doesn’t work, don’t see any events :frowning:

Thanks, best regards

  1. Please attach your log.txt.
    Before attaching it try loading scheduler and saving events while you have
$scheduler->render_sql($consulta_sql,"task.id","task.date,task.date_end,nom_mostrar,task.name,task.description,task.status_id,task.priority,task.contact_name,task.contact_phone,task.contact_email,task.employer_id");

and then the same with

$scheduler->render_sql($consulta_sql,"id","date,date_end,nom_mostrar,name,description,status_id,priority,contact_name,contact_phone,contact_email,employer_id");
  1. Edit your
scheduler.load("<?= url_for('calendar/seleccionarEvents') ?>");

so it will call calendar/seleccionarEvents.php as calendar/seleccionarEvents.php?id=random_number_here
I guess this could work:

scheduler.load("<?= url_for('calendar/seleccionarEvents') ?>"+"?id="+scheduler.uid());

Best regards,
Ilya

  1. I attached the logs with tablename (task) or without. I’ve seen that the logWithTablename.txt have errors, the events in this case doesn’t show in the scheduler, is empty.

  2. Wow! Many thanks!! The scheduler works on IE8! The solution was easier than it looked. Thanks!

Best regards,

  1. Leave this version:
$scheduler->render_sql($consulta_sql,"id","date,date_end,nom_mostrar,name,description,status_id,priority,contact_name,contact_phone,contact_email,employer_id");
  1. Create another file - updateEvents.php for example
    With similar to the following content:

[code]<?php
include (’…/…/…/codebase/connector/scheduler_connector.php’);
include (’…/…/common/config.php’);

$res=mysql_connect($server, $user, $pass);
mysql_select_db($db_name);

$scheduler = new schedulerConnector($res);
$scheduler->enable_log("update_events_log.txt",true);

$scheduler->access->deny("delete"); //blocks Delete action
$scheduler->set_encoding("iso-8859-1");	

$scheduler->render_table("task","id","date, date_end, name, description, status_id, priority, contact_name, contact_phone, contact_email, employer_id");	

?>[/code]
3. Edit your html file:

scheduler.load("<?= url_for('calendar/seleccionarEvents') ?>"); var dp = new dataProcessor("updateEvents.php");
With this changes seleccionarEvents.php would only select necessary information while updateEvents.php handle all updates/inserts/deletes.

Hope this helps.

Best regards,
Ilya

I can only say … THANKS!!! My scheduler works great now! Many thanks for all the support Ilya, and sorry for the inconvenience.

Thanks, best regards!

  • Zaida -