Add rss export in agenda module
This commit is contained in:
parent
cbfcd1c7e8
commit
8aa261fb8f
@ -625,7 +625,8 @@ class ActionComm
|
||||
$event['enddate']=$dateend; // Not required with type 'journal'
|
||||
$event['summary']=$obj->label;
|
||||
$event['desc']=$obj->note;
|
||||
$event['author']=$obj->fk_user_done>0?$obj->fk_user_done:$obj->fk_user_action;
|
||||
$event['category']=$obj->libelle;
|
||||
$event['author']=$obj->fk_user_author;
|
||||
$event['transparency']='TRANSPARENT'; // TRANSPARENT or OPAQUE
|
||||
$url=$dolibarr_main_url_root.DOL_URL_ROOT;
|
||||
if (! eregi('\/$',$url)) $url.='/';
|
||||
|
||||
@ -209,7 +209,7 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
|
||||
\param format 'rss'
|
||||
\param title Title of export
|
||||
\param desc Description of export
|
||||
\param events_array Array of events ('eid','startdate','duration','enddate','title','summary','category','email','url','desc','author')
|
||||
\param events_array Array of events ('uid','startdate','summary','url','desc','author','category')
|
||||
\param outputfile Output file
|
||||
\param filter Filter
|
||||
\return int <0 if ko, Nb of events in file if ok
|
||||
@ -223,7 +223,6 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
|
||||
$fichier=fopen($outputfile,'w');
|
||||
if ($fichier)
|
||||
{
|
||||
$now=mktime();
|
||||
$date=date("r");
|
||||
|
||||
// Print header
|
||||
@ -234,24 +233,25 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
|
||||
fwrite($fichier, $html);
|
||||
fwrite($fichier, "\n");
|
||||
|
||||
$html="<channel>".
|
||||
"\n".
|
||||
"<title>".$title."</title>";
|
||||
$html="<channel>\n".
|
||||
"<title>".$title."</title>\n";
|
||||
fwrite($fichier, $html);
|
||||
fwrite($fichier, "\n");
|
||||
|
||||
$html='<description><![CDATA['.$desc.'.]]></description>'.
|
||||
// '<language>fr</language>'.
|
||||
'<copyright>Dolibarr</copyright>'.
|
||||
'<lastBuildDate>'.$date.'</lastBuildDate>'.
|
||||
'<generator>Dolibarr</generator>'.
|
||||
'<link><![CDATA['.$_SERVER["PHP_SELF"].']]></link>';
|
||||
// '<image>'.
|
||||
// '<url><![CDATA[http://www.lesbonnesannonces.com/images/logo_rss.gif]]></url>'.
|
||||
// '<title><![CDATA[Dolibarr events]]></title>'.
|
||||
// '<link><![CDATA[http://www.lesbonnesannonces.com/]]></link>'.
|
||||
// '<width>144</width>'.
|
||||
// '<height>36</height>'.
|
||||
$html='<description><![CDATA['.$desc.'.]]></description>'."\n".
|
||||
// '<language>fr</language>'."\n".
|
||||
'<copyright>Dolibarr</copyright>'."\n".
|
||||
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
|
||||
'<generator>Dolibarr</generator>'."\n".
|
||||
'<link><![CDATA['.$_SERVER["PHP_SELF"].']]></link>'."\n";
|
||||
// '<managingEditor>editor@example.com</managingEditor>'."\n"
|
||||
// '<webMaster>webmaster@example.com</webMaster>'."\n"
|
||||
// '<ttl>5</ttl>'."\n"
|
||||
// '<image>'."\n"
|
||||
// '<url><![CDATA[http://www.lesbonnesannonces.com/images/logo_rss.gif]]></url>'."\n"
|
||||
// '<title><![CDATA[Dolibarr events]]></title>'."\n"
|
||||
// '<link><![CDATA[http://www.lesbonnesannonces.com/]]></link>'."\n"
|
||||
// '<width>144</width>'."\n"
|
||||
// '<height>36</height>'."\n"
|
||||
// '</image>'."\n";
|
||||
|
||||
#print $html;
|
||||
@ -270,42 +270,28 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
|
||||
|
||||
if ($eventqualified)
|
||||
{
|
||||
//$uid = dolibarr_print_date($now,'dayhourxcard').'-'.$event['uid']."-export@".$_SERVER["SERVER_NAME"];
|
||||
$uid = $event['uid'];
|
||||
$type = $event['type'];
|
||||
$uid = $event['uid'];
|
||||
$startdate = $event['startdate'];
|
||||
$duration = $event['duration'];
|
||||
$enddate = $event['enddate'];
|
||||
$summary = $event['summary'];
|
||||
$category = $event['category'];
|
||||
$location = $event['location'];
|
||||
$email = $event['email'];
|
||||
$url = $event['url'];
|
||||
$transparency = $event['transparency'];
|
||||
$author = $event['author'];
|
||||
$category = $event['category'];
|
||||
$description=eregi_replace('<br[ \/]?>',"\n",$event['desc']);
|
||||
$description=clean_html($description,0); // Remove html tags
|
||||
|
||||
|
||||
fwrite ($fichier, "<item>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "<title><![CDATA[".$summary."]]></title>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "<link><![CDATA[".$url."]]></link>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "<item>\n");
|
||||
fwrite ($fichier, "<title><![CDATA[".$summary."]]></title>"."\n");
|
||||
fwrite ($fichier, "<link><![CDATA[".$url."]]></link>"."\n");
|
||||
fwrite ($fichier, "<author><![CDATA[".$author."]]></author>"."\n");
|
||||
fwrite ($fichier, "<category><![CDATA[".$category."]]></category>"."\n");
|
||||
fwrite ($fichier, "<description><![CDATA[");
|
||||
if ($description) fwrite ($fichier, $description);
|
||||
//else fwrite ($fichier, 'NoDesc');
|
||||
fwrite ($fichier, "]]></description>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "<pubDate>".date("r", $startdate)."</pubDate>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, '<guid isPermaLink="true"><![CDATA[');
|
||||
// http://www.lesbonnesannonces.com/index_categ.php?origine=&id_categ='.$id_categ.
|
||||
fwrite ($fichier, $url);
|
||||
fwrite ($fichier, ']]></guid>');
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "</item>");
|
||||
fwrite ($fichier, "\n");
|
||||
fwrite ($fichier, "]]></description>\n");
|
||||
fwrite ($fichier, "<pubDate>".date("r", $startdate)."</pubDate>\n");
|
||||
fwrite ($fichier, "<guid isPermaLink=\"true\"><![CDATA[".$uid."]]></guid>\n");
|
||||
fwrite ($fichier, "<source><![CDATA[Dolibarr]]></source>\n");
|
||||
fwrite ($fichier, "</item>\n");
|
||||
|
||||
//chmod($fichierout, 0664);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user