Fix: encoding for ical export
This commit is contained in:
parent
069ea7edb0
commit
d8d5dbbf21
@ -571,6 +571,8 @@ class ActionComm
|
|||||||
$result=0;
|
$result=0;
|
||||||
|
|
||||||
$buildfile=true;
|
$buildfile=true;
|
||||||
|
$login='';$logina='';$logind='';$logint='';
|
||||||
|
|
||||||
if ($cachedelay)
|
if ($cachedelay)
|
||||||
{
|
{
|
||||||
// \TODO Check cache
|
// \TODO Check cache
|
||||||
@ -603,6 +605,7 @@ class ActionComm
|
|||||||
if ($key == 'idaction') $sql.=' AND a.id='.$value;
|
if ($key == 'idaction') $sql.=' AND a.id='.$value;
|
||||||
if ($key == 'login')
|
if ($key == 'login')
|
||||||
{
|
{
|
||||||
|
$login=$value;
|
||||||
$userforfilter=new User($this->db);
|
$userforfilter=new User($this->db);
|
||||||
$userforfilter->fetch($value);
|
$userforfilter->fetch($value);
|
||||||
$sql.= " AND (";
|
$sql.= " AND (";
|
||||||
@ -613,18 +616,21 @@ class ActionComm
|
|||||||
}
|
}
|
||||||
if ($key == 'logina')
|
if ($key == 'logina')
|
||||||
{
|
{
|
||||||
|
$logina=$value;
|
||||||
$userforfilter=new User($this->db);
|
$userforfilter=new User($this->db);
|
||||||
$userforfilter->fetch($value);
|
$userforfilter->fetch($value);
|
||||||
$sql.= " AND a.fk_user_author = ".$userforfilter->id;
|
$sql.= " AND a.fk_user_author = ".$userforfilter->id;
|
||||||
}
|
}
|
||||||
if ($key == 'logint')
|
if ($key == 'logint')
|
||||||
{
|
{
|
||||||
|
$logint=$value;
|
||||||
$userforfilter=new User($this->db);
|
$userforfilter=new User($this->db);
|
||||||
$userforfilter->fetch($value);
|
$userforfilter->fetch($value);
|
||||||
$sql.= " AND a.fk_user_action = ".$userforfilter->id;
|
$sql.= " AND a.fk_user_action = ".$userforfilter->id;
|
||||||
}
|
}
|
||||||
if ($key == 'logind')
|
if ($key == 'logind')
|
||||||
{
|
{
|
||||||
|
$logind=$value;
|
||||||
$userforfilter=new User($this->db);
|
$userforfilter=new User($this->db);
|
||||||
$userforfilter->fetch($value);
|
$userforfilter->fetch($value);
|
||||||
$sql.= " AND a.fk_user_done = ".$userforfilter->id;
|
$sql.= " AND a.fk_user_done = ".$userforfilter->id;
|
||||||
@ -677,9 +683,25 @@ class ActionComm
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$langs->load("agenda");
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
$title='Dolibarr actions';
|
$more='';
|
||||||
$desc='List of actions - built by Dolibarr';
|
if ($login) $more=$langs->trans("User").' '.$login;
|
||||||
|
if ($logina) $more=$langs->trans("ActionsAskedBy").' '.$logina;
|
||||||
|
if ($logint) $more=$langs->trans("ActionsToDoBy").' '.$logint;
|
||||||
|
if ($logind) $more=$langs->trans("ActionsDoneBy").' '.$logind;
|
||||||
|
if ($more)
|
||||||
|
{
|
||||||
|
$title='Dolibarr actions - '.$more;
|
||||||
|
$desc=$more.' - built by Dolibarr';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$title='Dolibarr actions';
|
||||||
|
$desc=$langs->trans('ListOfActions').' - built by Dolibarr';
|
||||||
|
}
|
||||||
|
|
||||||
if ($format == 'ical') $result=build_calfile($format,$title,$desc,$eventarray,$outputfile);
|
if ($format == 'ical') $result=build_calfile($format,$title,$desc,$eventarray,$outputfile);
|
||||||
if ($format == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfile);
|
if ($format == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfile);
|
||||||
if ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfile);
|
if ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfile);
|
||||||
|
|||||||
@ -90,6 +90,8 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
|
|||||||
// Format
|
// Format
|
||||||
$summary=format_cal($format,$summary);
|
$summary=format_cal($format,$summary);
|
||||||
$description=format_cal($format,$description);
|
$description=format_cal($format,$description);
|
||||||
|
$category=format_cal($format,$category);
|
||||||
|
$location=format_cal($format,$location);
|
||||||
|
|
||||||
$encoding='';
|
$encoding='';
|
||||||
if ($format == 'vcal') $encoding='ENCODING=QUOTED-PRINTABLE:';
|
if ($format == 'vcal') $encoding='ENCODING=QUOTED-PRINTABLE:';
|
||||||
@ -132,8 +134,8 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi
|
|||||||
/ "CANCELLED" ;Indicates journal is removed.
|
/ "CANCELLED" ;Indicates journal is removed.
|
||||||
;Status values for "VJOURNAL".
|
;Status values for "VJOURNAL".
|
||||||
*/
|
*/
|
||||||
if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$category."\n");
|
if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$encoding.$category."\n");
|
||||||
if (! empty($location)) fwrite($calfileh,"LOCATION:".$location."\n");
|
if (! empty($location)) fwrite($calfileh,"LOCATION:".$encoding.$location."\n");
|
||||||
//fwrite($calfileh,"TRANSP:".$transparency."\n");
|
//fwrite($calfileh,"TRANSP:".$transparency."\n");
|
||||||
//fwrite($calfileh,"CLASS:PUBLIC\n"); // PUBLIC, PRIVATE, CONFIDENTIAL
|
//fwrite($calfileh,"CLASS:PUBLIC\n"); // PUBLIC, PRIVATE, CONFIDENTIAL
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user