Error on Agenda view, using recurring events.

Hello, we have a problem with Agenda view. When you have a recurring event without finish, agenda view try to load multiple events and die in a no end bucle. For this reason i think that there are a bug on a function. here my code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title></title>
</head>
	<script src="../../codebase/dhtmlxscheduler.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_recurring.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_agenda_view.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/dhtmlxcommon.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_year_view.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/dhtmlxcombo.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../sources/locale_es.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../codebase/ext/dhtmlxscheduler_active_links.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../sources/locale_recurring_es.js" type="text/javascript" charset="utf-8"></script>	
	<script src="../../codebase/ext/dhtmlxscheduler_units.js" type="text/javascript" charset="utf-8"></script>
	<link rel="stylesheet" href="../../codebase/dhtmlxscheduler.css" type="text/css" title="no title" charset="utf-8">
	<link rel="stylesheet" href="../../codebase/ext/dhtmlxscheduler_ext.css" type="text/css" title="no title" charset="utf-8">
	<link rel="stylesheet" href="../../codebase/ext/dhtmlxscheduler_recurring.css" type="text/css" title="no title" charset="utf-8">
	<link rel="stylesheet" href="../../codebase/dhtmlxcombo.css" type="text/css" title="no title" charset="utf-8">
	
<style type="text/css" media="screen">
	html, body{
		margin:0px;
		padding:0px;
		height:100%;
		overflow:hidden;
	}
	.dhx_combo_list{
		z-index:11000;
	}
</style>

<script type="text/javascript" charset="utf-8">
	function init(){
	//no executa PHP. s'ha de crear la variable "sections" a mà.
	//load dinamicaly "sections" variable.
	<?php include("php/scheduler.php");?>
		
	scheduler.form_blocks["combo"]={
		render:function(sns){
		var height=(sns.height||"23")+"px";
		var html="<div data='"+sns.xml+"' class='dhx_cal_ltext' style='height:"+height+";' id='"+scheduler.uid()+"'></div>";
		
		return html;
		},
		set_value:function(node,value,ev){
		if (!node.combo){
                node.combo = new dhtmlXCombo(node.id,"dummy","553px");
                node.combo.loadXML(node.getAttribute("data"),	function(){
                	node.combo.setComboValue(value||"");
					});
					return;
			}
			node.combo.setComboValue(value||"");
		},
		get_value:function(node,ev){
			return node.combo.getActualValue();
		},

		focus:function(node){
			node.combo.DOMelem_input.focus();
		}
	}
		
		var step = 15;
		var format = scheduler.date.date_to_str("%H:%i");
		
		scheduler.config.hour_size_px=(60/step)*21;
		scheduler.templates.hour_scale = function(date){
			html="";
			for (var i=0; i<60/step; i++){
				html+="<div style='height:21px;line-height:21px;'>"+format(date)+"</div>";
				date = scheduler.date.add(date,step,"minute");
			}
			return html;
		}
		
		dhtmlx.image_path="../../codebase/imgs/";
	
		scheduler.config.xml_date="%Y-%m-%d %H:%i";
		scheduler.config.details_on_create=true;
		scheduler.config.details_on_dblclick=true;
		scheduler.locale.labels.section_user = "Hosts";
		scheduler.locale.labels.unit_tab = "Units"
		scheduler.locale.labels.agenda_tab = "Agenda"
		scheduler.locale.labels.year_tab = "Year"
		
		scheduler.config.lightbox.sections=[
		{name:"description", height:50, map_to:"text", type:"textarea" , focus:true},
		{name:"user", height:23, xml:"data.php", type:"combo", map_to:"section_id"},
		{name:"recurring",height:115, type:"recurring", button:"recurring", map_to:"rec_type"},
		{name:"time", height:72, type:"time", map_to:"auto"}
		];

		scheduler.createUnitsView("unit","section_id",sections);
		scheduler.init('scheduler_here',null,"month");
		scheduler.load("php/events_rec.php?uid="+scheduler.uid());
	
		var dp = new dataProcessor("php/events_rec.php");
		dp.init(scheduler);
	}
</script>

<body onload="init();">

	<div id="scheduler_here" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<div class="dhx_cal_tab" name="agenda_tab" style="right:280px;"></div>
			<div class="dhx_cal_tab" name="unit_tab" style="right:350px;"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
			<div class="dhx_cal_tab" name="year_tab" style="right:420px;"></div>
		</div>
		<div class="dhx_cal_header">
		</div>
		<div class="dhx_cal_data">
		</div>		
	</div>
</body>

Existing version hasn’t fixed end date for agenda view, so any recurring event , without end date, will produce an infinite list of oncoming events, which will break normal functionality.

To fix the issue, you can try to use the next file
support.dhtmlx.com/x-files/sched … a_view.zip

It allows to use

scheduler.config.agenda_end = scheduler.date.add(new Date(),3,"month");

Ok, now it runs correctly. Thanks for your attention.

Also, We have another question.
We want to know where is the query or the functions that populates the agenda view to use in a automatic worker that runs a script on every planificated event.
We have this idea:

On First step we want to use that query/function to connect to Data Base and extract the events and all recurrences of recurring events.
The finaly objective is to get a table with the same rows and columns that we have on agenda view

From Barcelona, we salute you.

On client side you can use scheduler.getEvents(start, end) to get a list of events in the define time period

There is a PHP helper class, which can do the same for a server side code
support.dhtmlx.com/x-files/sched … events.zip