diff --git a/htdocs/lib/xcal.lib.php b/htdocs/lib/xcal.lib.php
index fd4a94a9feb..e5540936efa 100644
--- a/htdocs/lib/xcal.lib.php
+++ b/htdocs/lib/xcal.lib.php
@@ -216,6 +216,9 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
*/
function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$filter='')
{
+ global $user,$conf,$langs;
+ global $dolibarr_main_url_root;
+
dolibarr_syslog("xcal.lib.php::build_rssfile Build rss file ".$outputfile." to format ".$format);
if (empty($outputfile)) return -1;
@@ -241,8 +244,12 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
// 'fr'."\n".
'Dolibarr'."\n".
''.$date.''."\n".
- 'Dolibarr'."\n".
- ''."\n";
+ 'Dolibarr'."\n";
+
+ $url=$dolibarr_main_url_root;
+ if (! eregi('\/$',$url)) $url.='/';
+ $url.='comm/action/agendaexport.php?format=rss&exportkey='.urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY);
+ $html.=''."\n";
// 'editor@example.com'."\n"
// 'webmaster@example.com'."\n"
// '5'."\n"