@@ -74,33 +74,30 @@ public function retrieve($request)
7474
7575 $ result = '' ;
7676
77- $ result .= "BEGIN:VCALENDAR \n" ;
78- $ result .= "VERSION:2.0 \n" ;
79- $ result .= "PRODID:-// OpenSTAManager \n" ;
77+ $ result .= "BEGIN:VCALENDAR \r\ n" ;
78+ $ result .= "VERSION:2.0 \r\ n" ;
79+ $ result .= "PRODID:-// OpenSTAManager \r\ n" ;
8080
8181 foreach ($ rs as $ r ) {
82- $ description = str_replace ("\r\n" , "\n" , strip_tags ((string ) $ r ['description ' ]));
82+ $ description = str_replace ("\r\n" , "\n" , strip_tags ((string ) $ r ['richiesta ' ]));
8383 $ description = str_replace ("\r" , "\n" , $ description );
84- $ description = str_replace ("\n" , '\\n ' , $ description );
85-
86- $ r ['summary ' ] = str_replace ("\r\n" , "\n" , $ r ['summary ' ]);
84+ $ description = str_replace ("\n" , '\\r \\n ' , $ description );
8785
8886 $ now = new Carbon ();
8987 $ inizio = new Carbon ($ r ['orario_inizio ' ]);
9088 $ fine = new Carbon ($ r ['orario_fine ' ]);
9189
92- $ result .= "BEGIN:VEVENT \n" ;
93- $ result .= 'UID: ' .$ r ['idriga ' ]."\n" ;
94- $ result .= 'DTSTAMP: ' .$ now ->format ('Ymd\THis ' )."\n" ;
95- // $result .= 'ORGANIZER;CN='.$azienda.':MAILTO:'.$email."\n";
96- $ result .= 'DTSTART: ' .$ inizio ->format ('Ymd\THis ' )."\n" ;
97- $ result .= 'DTEND: ' .$ fine ->format ('Ymd\THis ' )."\n" ;
98- $ result .= 'SUMMARY: ' .html_entity_decode ($ r ['summary ' ])."\n" ;
99- $ result .= 'DESCRIPTION: ' .html_entity_decode ($ description , ENT_QUOTES , 'UTF-8 ' )."\n" ;
100- $ result .= "END:VEVENT \n" ;
90+ $ result .= "BEGIN:VEVENT \r\n" ;
91+ $ result .= 'UID: ' .$ r ['idriga ' ]."\r\n" ;
92+ $ result .= 'DTSTAMP: ' .$ now ->format ('Ymd\THis ' )."\r\n" ;
93+ $ result .= 'DTSTART: ' .$ inizio ->format ('Ymd\THis ' )."\r\n" ;
94+ $ result .= 'DTEND: ' .$ fine ->format ('Ymd\THis ' )."\r\n" ;
95+ $ result .= 'SUMMARY: ' .html_entity_decode ($ r ['summary ' ])."\r\n" ;
96+ $ result .= 'DESCRIPTION: ' .html_entity_decode ($ description , ENT_QUOTES , 'UTF-8 ' )."\r\n" ;
97+ $ result .= "END:VEVENT \r\n" ;
10198 }
10299
103- $ result .= "END:VCALENDAR \n" ;
100+ $ result .= "END:VCALENDAR \r\ n" ;
104101
105102 return [
106103 'custom ' => $ result ,
0 commit comments