From 9af5354dfe2885040f7b1b3da0e31e09126e60fa Mon Sep 17 00:00:00 2001 From: "Sekan, Tobias" Date: Fri, 21 Aug 2020 13:57:03 +0200 Subject: [PATCH 1/2] Parse priority and transparency from external calender events --- htdocs/comm/action/index.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 97d732f6908..b04bd5ae0c5 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1072,6 +1072,26 @@ if (count($listofextcals)) elseif ($icalevent['DESCRIPTION']) $event->label = dol_nl2br($icalevent['DESCRIPTION'], 1); else $event->label = $langs->trans("ExtSiteNoLabel"); + // Priority (see https://www.kanzaki.com/docs/ical/priority.html) + // LOW = 0 to 4 + // MEDIUM = 5 + // HIGH = 6 to 9 + if ($icalevent['PRIORITY']) $event->priority = $icalevent['PRIORITY']; + + // Transparency (see https://www.kanzaki.com/docs/ical/transp.html) + if ($icalevent['TRANSP']) + { + if($icalevent['TRANSP'] == "TRANSPARENT") $event->transparency = 0; // 0 = available / free + if($icalevent['TRANSP'] == "OPAQUE") $event->transparency = 1; // 1 = busy + + // TODO: MS outlook states + // X-MICROSOFT-CDO-BUSYSTATUS:FREE + TRANSP:TRANSPARENT => Available / Free + // X-MICROSOFT-CDO-BUSYSTATUS:FREE + TRANSP:OPAQUE => Work another place + // X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE + TRANSP:OPAQUE => With reservations + // X-MICROSOFT-CDO-BUSYSTATUS:BUSY + TRANSP:OPAQUE => Busy + // X-MICROSOFT-CDO-BUSYSTATUS:OOF + TRANSP:OPAQUE => Away from the office / off-site + } + $event->date_start_in_calendar = $event->datep; if ($event->datef != '' && $event->datef >= $event->datep) $event->date_end_in_calendar = $event->datef; From 183013e9ed900fcf374cbc3c1fa5e59179fbe2d0 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 21 Aug 2020 12:02:03 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/comm/action/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index b04bd5ae0c5..bdf6b80a56a 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1081,8 +1081,8 @@ if (count($listofextcals)) // Transparency (see https://www.kanzaki.com/docs/ical/transp.html) if ($icalevent['TRANSP']) { - if($icalevent['TRANSP'] == "TRANSPARENT") $event->transparency = 0; // 0 = available / free - if($icalevent['TRANSP'] == "OPAQUE") $event->transparency = 1; // 1 = busy + if ($icalevent['TRANSP'] == "TRANSPARENT") $event->transparency = 0; // 0 = available / free + if ($icalevent['TRANSP'] == "OPAQUE") $event->transparency = 1; // 1 = busy // TODO: MS outlook states // X-MICROSOFT-CDO-BUSYSTATUS:FREE + TRANSP:TRANSPARENT => Available / Free