diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 580d2c3ba00..6233ed5a2e6 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -571,6 +571,8 @@ class ActionComm $result=0; $buildfile=true; + $login='';$logina='';$logind='';$logint=''; + if ($cachedelay) { // \TODO Check cache @@ -603,6 +605,7 @@ class ActionComm if ($key == 'idaction') $sql.=' AND a.id='.$value; if ($key == 'login') { + $login=$value; $userforfilter=new User($this->db); $userforfilter->fetch($value); $sql.= " AND ("; @@ -613,18 +616,21 @@ class ActionComm } if ($key == 'logina') { + $logina=$value; $userforfilter=new User($this->db); $userforfilter->fetch($value); $sql.= " AND a.fk_user_author = ".$userforfilter->id; } if ($key == 'logint') { + $logint=$value; $userforfilter=new User($this->db); $userforfilter->fetch($value); $sql.= " AND a.fk_user_action = ".$userforfilter->id; } if ($key == 'logind') { + $logind=$value; $userforfilter=new User($this->db); $userforfilter->fetch($value); $sql.= " AND a.fk_user_done = ".$userforfilter->id; @@ -677,9 +683,25 @@ class ActionComm return -1; } + $langs->load("agenda"); + // Write file - $title='Dolibarr actions'; - $desc='List of actions - built by Dolibarr'; + $more=''; + 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 == 'vcal') $result=build_calfile($format,$title,$desc,$eventarray,$outputfile); if ($format == 'rss') $result=build_rssfile($format,$title,$desc,$eventarray,$outputfile); diff --git a/htdocs/lib/xcal.lib.php b/htdocs/lib/xcal.lib.php index e6fd87a05de..9c31a7e0648 100644 --- a/htdocs/lib/xcal.lib.php +++ b/htdocs/lib/xcal.lib.php @@ -90,6 +90,8 @@ function build_calfile($format='vcal',$title,$desc,$events_array,$outputfile,$fi // Format $summary=format_cal($format,$summary); $description=format_cal($format,$description); + $category=format_cal($format,$category); + $location=format_cal($format,$location); $encoding=''; 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. ;Status values for "VJOURNAL". */ - if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$category."\n"); - if (! empty($location)) fwrite($calfileh,"LOCATION:".$location."\n"); + if (! empty($category)) fwrite($calfileh,"CATEGORIES:".$encoding.$category."\n"); + if (! empty($location)) fwrite($calfileh,"LOCATION:".$encoding.$location."\n"); //fwrite($calfileh,"TRANSP:".$transparency."\n"); //fwrite($calfileh,"CLASS:PUBLIC\n"); // PUBLIC, PRIVATE, CONFIDENTIAL