From e5e20cf35ad2d50ee62563a24da5171c8f828374 Mon Sep 17 00:00:00 2001 From: Barbara Bothe Date: Mon, 7 Aug 2023 10:16:39 +0200 Subject: [PATCH 01/17] =?UTF-8?q?Shortcodes=20in=20Description=20m=C3=B6gl?= =?UTF-8?q?ich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/CPT/CalendarEvent.php | 2 +- includes/Shortcodes/Calendar.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/CPT/CalendarEvent.php b/includes/CPT/CalendarEvent.php index 149c5a91..83b4d1bb 100644 --- a/includes/CPT/CalendarEvent.php +++ b/includes/CPT/CalendarEvent.php @@ -652,7 +652,7 @@ public static function displayEventMain($data) // Description echo '
'; - echo wpautop($data['description']); + echo wpautop(do_shortcode($data['description'])); echo '
'; } diff --git a/includes/Shortcodes/Calendar.php b/includes/Shortcodes/Calendar.php index 8e0c1101..23a2b75f 100644 --- a/includes/Shortcodes/Calendar.php +++ b/includes/Shortcodes/Calendar.php @@ -575,7 +575,7 @@ private static function renderMonthCalendarFull($year, $month, $eventsArray = [ } $thumbnail = get_the_post_thumbnail($event['id'], 'medium'); $content = get_post_meta($event['id'], 'description', true); - $excerpt = strip_tags($content); + $excerpt = strip_tags(do_shortcode($content)); if (strlen($excerpt) > 100) { $excerpt = substr($excerpt, 0, 100); $excerpt = '' . substr($excerpt, 0, strrpos($excerpt, ' ')) . '…'; From 040430910333178d15ccf0af412f17d1e1488c10 Mon Sep 17 00:00:00 2001 From: Barbara Bothe Date: Mon, 7 Aug 2023 10:56:58 +0200 Subject: [PATCH 02/17] Border-Radius per Custom Variable fixes #148 --- build/calendar.css | 2 +- src/calendar/style.scss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/calendar.css b/build/calendar.css index f43d45af..c2b1f0fe 100644 --- a/build/calendar.css +++ b/build/calendar.css @@ -1 +1 @@ -.rrze-calendar{margin:1em 0}.rrze-calendar .cal-type-select{padding:0}.rrze-calendar .cal-type-select a{display:inline-block;margin-right:.5em;padding:.25em 1em;border:2px solid #666;border-radius:4px;text-decoration:none;box-shadow:none}.rrze-calendar .cal-type-select a:hover,.rrze-calendar .cal-type-select a:focus,.rrze-calendar .cal-type-select a:active,.rrze-calendar .cal-type-select a.active{background:#666;color:#fff}.rrze-calendar .cal-day .calendar-header h2.title-year{padding-bottom:.5em;margin-bottom:1em;border-bottom:1px solid #ccc}.rrze-calendar .cal-day .event-date{color:#666;font-style:italic;display:inline;width:auto;height:auto;background:rgba(0,0,0,0);padding:0;margin:0}.rrze-calendar .calendar-year{clear:both;width:100%;display:flex;flex-wrap:wrap;justify-content:space-around;text-align:center}.rrze-calendar .calendar-year .calendar-month.mini table{width:100%}.rrze-calendar .calendar-month.mini table{width:auto;min-width:240px;text-align:center}.rrze-calendar .calendar-month.mini th{text-align:center}.rrze-calendar .calendar-month.mini th a{text-decoration:none}.rrze-calendar .calendar-month.mini th a:hover,.rrze-calendar .calendar-month.mini th a:focus,.rrze-calendar .calendar-month.mini th a:active{text-decoration:underline}.rrze-calendar .calendar-month.mini td{text-align:center}.rrze-calendar .calendar-month.mini td.has-events{background:#fdfad3;padding:0}.rrze-calendar .calendar-month.mini td.has-events a{display:block;padding:5px;box-shadow:none}.rrze-calendar .calendar-month.mini td.has-events a:hover,.rrze-calendar .calendar-month.mini td.has-events a:focus,.rrze-calendar .calendar-month.mini td.has-events a:active{color:unset;background:#fefdeb;font-weight:bold}.rrze-calendar .calendar-month.mini td.has-events:hover,.rrze-calendar .calendar-month.mini td.has-events:focus,.rrze-calendar .calendar-month.mini td.has-events:active{background:#fefdeb}.rrze-calendar .calendar-month.mini tr.days{border-bottom:none}.rrze-calendar .calendar-month.mini tr.days td{border-bottom:1px solid var(--color-primary-ci-hell, #003366)}.rrze-calendar .calendar-header{width:100%;position:relative}.rrze-calendar .calendar-header h2.title-year{text-align:center;margin-bottom:.25em}.rrze-calendar .calendar-header ul.calendar-pager{margin:0;padding:0}.rrze-calendar .calendar-header ul.calendar-pager li{list-style-type:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li{position:absolute;top:0;padding:10px 0}}.rrze-calendar .calendar-header ul.calendar-pager li.date-prev{float:left}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li.date-prev{float:none;left:0;right:auto}}.rrze-calendar .calendar-header ul.calendar-pager li.date-next{float:right}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li.date-next{float:none;right:0;left:auto}}.rrze-calendar .calendar-month{clear:both;padding:5px}.rrze-calendar .calendar-month tr.days td{border:none;border-bottom:1px solid #ccc}.rrze-calendar .calendar-month td{border:1px solid #fff}.rrze-calendar .calendar-month.mini{min-width:25%}.rrze-calendar .calendar-month.full{width:100%}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .days,.rrze-calendar .calendar-month.full .week{display:grid;grid-template-columns:[day-1] 1fr [day-2] 1fr [day-3] 1fr [day-4] 1fr [day-5] 1fr [day-6] 1fr [day-7] 1fr;grid-template-rows:repeat(auto-fit, 1fr)}}.rrze-calendar .calendar-month.full .day-names{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .day-names{display:block;font-weight:bold;text-align:center;font-style:italic;border:1px solid #ccc;border-bottom-color:#666}}.rrze-calendar .calendar-month.full .day{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .day{display:block;border:1px solid #ccc;border-bottom-color:rgba(0,0,0,0);padding:5px 7px;text-align:right}}.rrze-calendar .calendar-month.full .empty-day{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .empty-day{display:block;border:1px solid #ccc;background:#f6f6f6}}.rrze-calendar .calendar-month.full .no-event{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .no-event{display:block;min-height:90px;border:1px solid #ccc;border-top-color:rgba(0,0,0,0)}}.rrze-calendar .calendar-month.full .event{display:block;position:relative;text-align:left;min-width:0;min-height:0;padding:10px;margin-bottom:5px;font-size:small;border:2px solid var(--color-primary-ci-hell, #003366);border-top-width:4px;background-color:#fff}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event{padding:3px 5px;line-height:1.3;margin-bottom:3px;min-height:25px;position:relative}}.rrze-calendar .calendar-month.full .event:before,.rrze-calendar .calendar-month.full .event:after{display:inline-block;width:16px;color:#666;font-style:normal}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:before{content:"«";float:left}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:after{content:"»";text-align:right;position:absolute;bottom:0;right:5px}}.rrze-calendar .calendar-month.full .event p{margin-bottom:0;padding-bottom:0;font-size:.875rem;line-height:1.5}.rrze-calendar .calendar-month.full .event div[role=tooltip]{display:none}.rrze-calendar .calendar-month.full .event div[role=tooltip] .wp-post-image{margin-bottom:5px}.rrze-calendar .calendar-month.full .event div[role=tooltip] .event-title{display:block;font-weight:bold;font-size:1.2em;margin-bottom:5px}.rrze-calendar .calendar-month.full .event div[role=tooltip] .event-date-time{margin-bottom:5px}.rrze-calendar .calendar-month.full .event:hover div[role=tooltip]{display:block;position:absolute;bottom:1em;left:.5em;width:15em;padding:.5em;z-index:100;color:#000;background-color:#fefefe;border:solid 2px #ccc;border-radius:.2em;box-shadow:2px 2px 5px #ccc}.rrze-calendar .calendar-month.full .event a{text-decoration:none}.rrze-calendar .calendar-month.full .event a:hover,.rrze-calendar .calendar-month.full .event a:focus,.rrze-calendar .calendar-month.full .event a:active{text-decoration:underline}.rrze-calendar .calendar-month.full .event:not(.event-start){display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-start){display:block;padding-left:5px}.rrze-calendar .calendar-month.full .event:not(.event-start) a{width:calc(100% - 20px)}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-end){padding-right:5px}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-start):not(.event-end) a{width:calc(100% - 40px)}}.rrze-calendar .calendar-month.full .event-date{width:auto;background:rgba(0,0,0,0);font-style:italic;color:#666;padding:0;margin:0;font-size:.875rem;line-height:1.5;text-align:left}.rrze-calendar .calendar-month.full .event-title{display:block;word-break:break-word}@media screen and (min-width: 960px){.rrze-calendar .calendar-month.full .event-title{word-break:break-word}}.rrze-calendar .calendar-month.full .mec-event-date,.rrze-calendar .calendar-month.full .event-time{font-style:italic;color:#666}.rrze-calendar .calendar-month.full .event-start:before{display:none;content:""}.rrze-calendar .calendar-month.full .event-end{float:none}.rrze-calendar .calendar-month.full .event-end:after{display:none;content:""}.rrze-calendar .calendar-month.full .more-events{padding:0 5px;font-size:smaller}.rrze-calendar ul.day-list li{margin-bottom:.5em}@media screen and (min-width: 480px){.rrze-calendar .hide-desktop{border:0;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}}/*# sourceMappingURL=calendar.css.map */ +.rrze-calendar{margin:1em 0}.rrze-calendar .cal-type-select{padding:0}.rrze-calendar .cal-type-select a{display:inline-block;margin-right:.5em;padding:.25em 1em;border:2px solid #666;border-radius:var(--border-radius-buttons, 4px);text-decoration:none;box-shadow:none}.rrze-calendar .cal-type-select a:hover,.rrze-calendar .cal-type-select a:focus,.rrze-calendar .cal-type-select a:active,.rrze-calendar .cal-type-select a.active{background:#666;color:#fff}.rrze-calendar .cal-day .calendar-header h2.title-year{padding-bottom:.5em;margin-bottom:1em;border-bottom:1px solid #ccc}.rrze-calendar .cal-day .event-date{color:#666;font-style:italic;display:inline;width:auto;height:auto;background:rgba(0,0,0,0);padding:0;margin:0}.rrze-calendar .calendar-year{clear:both;width:100%;display:flex;flex-wrap:wrap;justify-content:space-around;text-align:center}.rrze-calendar .calendar-year .calendar-month.mini table{width:100%}.rrze-calendar .calendar-month.mini table{width:auto;min-width:240px;text-align:center}.rrze-calendar .calendar-month.mini th{text-align:center}.rrze-calendar .calendar-month.mini th a{text-decoration:none}.rrze-calendar .calendar-month.mini th a:hover,.rrze-calendar .calendar-month.mini th a:focus,.rrze-calendar .calendar-month.mini th a:active{text-decoration:underline}.rrze-calendar .calendar-month.mini td{text-align:center}.rrze-calendar .calendar-month.mini td.has-events{background:#fdfad3;padding:0}.rrze-calendar .calendar-month.mini td.has-events a{display:block;padding:5px;box-shadow:none}.rrze-calendar .calendar-month.mini td.has-events a:hover,.rrze-calendar .calendar-month.mini td.has-events a:focus,.rrze-calendar .calendar-month.mini td.has-events a:active{color:unset;background:#fefdeb;font-weight:bold}.rrze-calendar .calendar-month.mini td.has-events:hover,.rrze-calendar .calendar-month.mini td.has-events:focus,.rrze-calendar .calendar-month.mini td.has-events:active{background:#fefdeb}.rrze-calendar .calendar-month.mini tr.days{border-bottom:none}.rrze-calendar .calendar-month.mini tr.days td{border-bottom:1px solid var(--color-primary-ci-hell, #003366)}.rrze-calendar .calendar-header{width:100%;position:relative}.rrze-calendar .calendar-header h2.title-year{text-align:center;margin-bottom:.25em}.rrze-calendar .calendar-header ul.calendar-pager{margin:0;padding:0}.rrze-calendar .calendar-header ul.calendar-pager li{list-style-type:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li{position:absolute;top:0;padding:10px 0}}.rrze-calendar .calendar-header ul.calendar-pager li.date-prev{float:left}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li.date-prev{float:none;left:0;right:auto}}.rrze-calendar .calendar-header ul.calendar-pager li.date-next{float:right}@media screen and (min-width: 480px){.rrze-calendar .calendar-header ul.calendar-pager li.date-next{float:none;right:0;left:auto}}.rrze-calendar .calendar-month{clear:both;padding:5px}.rrze-calendar .calendar-month tr.days td{border:none;border-bottom:1px solid #ccc}.rrze-calendar .calendar-month td{border:1px solid #fff}.rrze-calendar .calendar-month.mini{min-width:25%}.rrze-calendar .calendar-month.full{width:100%}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .days,.rrze-calendar .calendar-month.full .week{display:grid;grid-template-columns:[day-1] 1fr [day-2] 1fr [day-3] 1fr [day-4] 1fr [day-5] 1fr [day-6] 1fr [day-7] 1fr;grid-template-rows:repeat(auto-fit, 1fr)}}.rrze-calendar .calendar-month.full .day-names{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .day-names{display:block;font-weight:bold;text-align:center;font-style:italic;border:1px solid #ccc;border-bottom-color:#666}}.rrze-calendar .calendar-month.full .day{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .day{display:block;border:1px solid #ccc;border-bottom-color:rgba(0,0,0,0);padding:5px 7px;text-align:right}}.rrze-calendar .calendar-month.full .empty-day{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .empty-day{display:block;border:1px solid #ccc;background:#f6f6f6}}.rrze-calendar .calendar-month.full .no-event{display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .no-event{display:block;min-height:90px;border:1px solid #ccc;border-top-color:rgba(0,0,0,0)}}.rrze-calendar .calendar-month.full .event{display:block;position:relative;text-align:left;min-width:0;min-height:0;padding:10px;margin-bottom:5px;font-size:small;border:2px solid var(--color-primary-ci-hell, #003366);border-top-width:4px;background-color:#fff}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event{padding:3px 5px;line-height:1.3;margin-bottom:3px;min-height:25px;position:relative}}.rrze-calendar .calendar-month.full .event:before,.rrze-calendar .calendar-month.full .event:after{display:inline-block;width:16px;color:#666;font-style:normal}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:before{content:"«";float:left}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:after{content:"»";text-align:right;position:absolute;bottom:0;right:5px}}.rrze-calendar .calendar-month.full .event p{margin-bottom:0;padding-bottom:0;font-size:.875rem;line-height:1.5}.rrze-calendar .calendar-month.full .event div[role=tooltip]{display:none}.rrze-calendar .calendar-month.full .event div[role=tooltip] .wp-post-image{margin-bottom:5px}.rrze-calendar .calendar-month.full .event div[role=tooltip] .event-title{display:block;font-weight:bold;font-size:1.2em;margin-bottom:5px}.rrze-calendar .calendar-month.full .event div[role=tooltip] .event-date-time{margin-bottom:5px}.rrze-calendar .calendar-month.full .event:hover div[role=tooltip]{display:block;position:absolute;bottom:1em;left:.5em;width:15em;padding:.5em;z-index:100;color:#000;background-color:#fefefe;border:solid 2px #ccc;border-radius:.2em;box-shadow:2px 2px 5px #ccc}.rrze-calendar .calendar-month.full .event a{text-decoration:none}.rrze-calendar .calendar-month.full .event a:hover,.rrze-calendar .calendar-month.full .event a:focus,.rrze-calendar .calendar-month.full .event a:active{text-decoration:underline}.rrze-calendar .calendar-month.full .event:not(.event-start){display:none}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-start){display:block;padding-left:5px}.rrze-calendar .calendar-month.full .event:not(.event-start) a{width:calc(100% - 20px)}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-end){padding-right:5px}}@media screen and (min-width: 480px){.rrze-calendar .calendar-month.full .event:not(.event-start):not(.event-end) a{width:calc(100% - 40px)}}.rrze-calendar .calendar-month.full .event-date{width:auto;background:rgba(0,0,0,0);font-style:italic;color:#666;padding:0;margin:0;font-size:.875rem;line-height:1.5;text-align:left}.rrze-calendar .calendar-month.full .event-title{display:block;word-break:break-word}@media screen and (min-width: 960px){.rrze-calendar .calendar-month.full .event-title{word-break:break-word}}.rrze-calendar .calendar-month.full .mec-event-date,.rrze-calendar .calendar-month.full .event-time{font-style:italic;color:#666}.rrze-calendar .calendar-month.full .event-start:before{display:none;content:""}.rrze-calendar .calendar-month.full .event-end{float:none}.rrze-calendar .calendar-month.full .event-end:after{display:none;content:""}.rrze-calendar .calendar-month.full .more-events{padding:0 5px;font-size:smaller}.rrze-calendar ul.day-list li{margin-bottom:.5em}@media screen and (min-width: 480px){.rrze-calendar .hide-desktop{border:0;clip:rect(1px, 1px, 1px, 1px);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute !important;width:1px;word-wrap:normal !important}}/*# sourceMappingURL=calendar.css.map */ diff --git a/src/calendar/style.scss b/src/calendar/style.scss index 1be6b927..3ef0e8cd 100644 --- a/src/calendar/style.scss +++ b/src/calendar/style.scss @@ -7,7 +7,7 @@ margin-right: .5em; padding: .25em 1em; border: 2px solid #666; - border-radius: 4px; + border-radius: var(--border-radius-buttons, 4px); text-decoration: none; box-shadow: none; //color: #333; @@ -209,7 +209,7 @@ border: 2px solid var(--color-primary-ci-hell, #003366); border-top-width: 4px; background-color: #ffffff; - //border-radius: 4px; + //border-radius: var(--border-radius-buttons, 4px); /*white-space: nowrap; overflow: hidden; text-overflow: ellipsis;*/ From 275bd719b2da6171048988da3a071c24f62c584f Mon Sep 17 00:00:00 2001 From: rvdforst Date: Mon, 7 Aug 2023 11:49:57 +0200 Subject: [PATCH 03/17] Add post caps to calendar_event --- includes/CPT/Capabilities.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/includes/CPT/Capabilities.php b/includes/CPT/Capabilities.php index 4dbc1a65..cc251b1a 100644 --- a/includes/CPT/Capabilities.php +++ b/includes/CPT/Capabilities.php @@ -13,23 +13,23 @@ protected static function currentCptArgs() 'capability_type' => CalendarEvent::POST_TYPE, 'capabilities' => [ // Meta capabilities - 'edit_post' => 'edit_page', - 'read_post' => 'read_page', - 'delete_post' => 'delete_page', + 'edit_post' => 'edit_post', + 'read_post' => 'read_post', + 'delete_post' => 'delete_post', // Primitive capabilities used outside of map_meta_cap() - 'edit_posts' => 'edit_pages', - 'edit_others_posts' => 'edit_others_pages', - 'publish_posts' => 'publish_pages', - 'read_private_posts' => 'read_private_pages', - // // Primitive capabilities used within map_meta_cap() + 'edit_posts' => 'edit_posts', + 'edit_others_posts' => 'edit_others_posts', + 'publish_posts' => 'publish_posts', + 'read_private_posts' => 'read_private_posts', + // Primitive capabilities used within map_meta_cap() 'read' => 'read', - 'delete_posts' => 'delete_pages', - 'delete_private_posts' => 'delete_private_pages', - 'delete_published_posts' => 'delete_published_pages', - 'delete_others_posts' => 'delete_others_pages', - 'edit_private_posts' => 'edit_private_pages', - 'edit_published_posts' => 'edit_published_pages', - 'create_posts' => 'edit_pages' + 'delete_posts' => 'delete_posts', + 'delete_private_posts' => 'delete_private_posts', + 'delete_published_posts' => 'delete_published_posts', + 'delete_others_posts' => 'delete_others_posts', + 'edit_private_posts' => 'edit_private_posts', + 'edit_published_posts' => 'edit_published_posts', + 'create_posts' => 'edit_posts' ], 'map_meta_cap' => true ], @@ -45,7 +45,7 @@ protected static function currentCptArgs() 'edit_others_posts' => 'edit_others_pages', 'publish_posts' => 'publish_pages', 'read_private_posts' => 'read_private_pages', - // // Primitive capabilities used within map_meta_cap() + // Primitive capabilities used within map_meta_cap() 'read' => 'read', 'delete_posts' => 'delete_pages', 'delete_private_posts' => 'delete_private_pages', From d94678b3323fc40d7ad8056168404248d17e064c Mon Sep 17 00:00:00 2001 From: rvdforst Date: Mon, 7 Aug 2023 12:20:31 +0200 Subject: [PATCH 04/17] Create ICS.php --- includes/ICS/ICS.php | 101 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 includes/ICS/ICS.php diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php new file mode 100644 index 00000000..e5e48795 --- /dev/null +++ b/includes/ICS/ICS.php @@ -0,0 +1,101 @@ +set($props); + } + + public function set($key, $value = false) + { + if (is_array($key)) { + foreach ($key as $k => $v) { + $this->set($k, $v); + } + } else { + if (in_array($key, $this->availableProperties)) { + $this->properties[$key] = $this->sanitizeValue($value, $key); + } + } + } + + public function make() + { + $rows = $this->build(); + return implode("\r\n", $rows); + } + + private function build() + { + $icsProps = [ + 'BEGIN:VCALENDAR', + 'METHOD:PUBLISH', + 'PRODID:' . str_replace('.', '-', parse_url(site_url(), PHP_URL_HOST)) . '//Events', + 'VERSION:2.0', + 'BEGIN:VEVENT' + ]; + + $props = []; + foreach ($this->properties as $k => $v) { + $props[strtoupper($k . ($k === 'url' ? ';VALUE=URI' : ''))] = $v; + } + + $props['DTSTAMP'] = $this->formatTimestamp('now'); + $props['UID'] = Utils::createUid(); + + foreach ($props as $k => $v) { + $icsProps[] = "$k:$v"; + } + + $icsProps[] = 'END:VEVENT'; + $icsProps[] = 'END:VCALENDAR'; + + return $icsProps; + } + + private function sanitizeValue($value, $key = false) + { + switch ($key) { + case 'dtend': + case 'dtstamp': + case 'dtstart': + $value = $this->formatTimestamp($value); + break; + default: + $value = $this->escStr($value); + } + + return $value; + } + + private function formatTimestamp($timestamp) + { + $dt = new \DateTime($timestamp); + return $dt->format(self::DT_FORMAT); + } + + private function escStr($str) + { + return preg_replace('/([\,;])/', '\\\$1', $str); + } +} From 4dacf27c3fb5b4e0576fd85fc955462268990762 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Mon, 7 Aug 2023 12:25:10 +0200 Subject: [PATCH 05/17] Update ICS.php --- includes/ICS/ICS.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php index e5e48795..d53f9c3d 100644 --- a/includes/ICS/ICS.php +++ b/includes/ICS/ICS.php @@ -13,6 +13,7 @@ class ICS protected $properties = []; private $availableProperties = [ + 'uid', 'description', 'dtend', 'dtstart', @@ -61,7 +62,6 @@ private function build() } $props['DTSTAMP'] = $this->formatTimestamp('now'); - $props['UID'] = Utils::createUid(); foreach ($props as $k => $v) { $icsProps[] = "$k:$v"; From 12a76d152a3cc1a9fe526cfb051cef2d2bb1ea1a Mon Sep 17 00:00:00 2001 From: rvdforst Date: Mon, 7 Aug 2023 13:59:51 +0200 Subject: [PATCH 06/17] Update ICS.php --- includes/ICS/ICS.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php index d53f9c3d..bdda513a 100644 --- a/includes/ICS/ICS.php +++ b/includes/ICS/ICS.php @@ -83,6 +83,8 @@ private function sanitizeValue($value, $key = false) break; default: $value = $this->escStr($value); + $value = str_replace("\r\n", "\\n", $value); + $value = $this->split($value); } return $value; @@ -98,4 +100,20 @@ private function escStr($str) { return preg_replace('/([\,;])/', '\\\$1', $str); } + + private function split($value) + { + $value = trim($value); + $lines = array(); + while (strlen($value) > (75)) { + $line = mb_substr($value, 0, 75); + $llength = mb_strlen($line); + $lines[] = $line . chr(13) . chr(10) . chr(32); + $value = mb_substr($value, $llength); + } + if (!empty($value)) { + $lines[] = $value; + } + return (implode($lines)); + } } From d6fdcb7adb7984e1199d93e0cb5c63e9e34d2e93 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Wed, 9 Aug 2023 15:19:20 +0200 Subject: [PATCH 07/17] Update composer.json --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index a8e42f75..17961f14 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,6 @@ "rrze/wp": "^1.2.1", "johngrogg/ics-parser": "^3.2.1", "rlanvin/php-rrule": "^2.4.1", - "jsvrcek/ics": "^0.8.4", "cmb2/cmb2": "^2.10.1" }, "suggest": { From 86c5080502381b20423798e7a18078bd01e9f878 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Wed, 9 Aug 2023 15:19:47 +0200 Subject: [PATCH 08/17] Create Export.php --- includes/ICS/Export.php | 152 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 includes/ICS/Export.php diff --git a/includes/ICS/Export.php b/includes/ICS/Export.php new file mode 100644 index 00000000..6dc1a734 --- /dev/null +++ b/includes/ICS/Export.php @@ -0,0 +1,152 @@ +getSlug()) + && $action === 'export' + ) { + $args = [ + 'postIds' => $_GET['ids'] ?: false, + 'categories' => $_GET['cats'] ?: false, + 'tags' => $_GET['tags'] ?: false + ]; + $this->set($args); + $this->stream(); + } + } + + private function set(array $args) + { + $postIds = $args['postIds'] ?? null; + $categories = $args['categories'] ?? null; + $tags = $args['tags'] ?? null; + $postIn = null; + $taxQuery = null; + $posts = null; + + if (is_array($postIds) && !empty($postIds)) { + $postIn = $postIds; + } + + if (is_array($categories) && !empty($categories)) { + $taxQuery = [ + [ + 'taxonomy' => CalendarEvent::TAX_CATEGORY, + 'field' => 'slug', + 'terms' => $categories + ] + ]; + } + + if (is_array($categories) && !empty($tags)) { + $taxQuery = array_merge( + $taxQuery, + [ + [ + 'taxonomy' => CalendarEvent::TAX_TAG, + 'field' => 'slug', + 'terms' => $tags + ] + ] + ); + } + + $args = [ + 'numberposts' => -1, + 'post_type' => CalendarEvent::POST_TYPE, + 'post_status' => 'publish' + ]; + + if (!empty($postIn)) { + $args = array_merge($args, ['post__in' => $postIds]); + } + if (!empty($taxQuery)) { + $taxQuery = array_merge(['relation' => 'AND'], $taxQuery); + $args = array_merge($args, ['tax_query' => $taxQuery]); + } + + if ($postIn || $taxQuery) { + $posts = get_posts($args); + $data = $this->getEvents($posts); + self::build(@$data); + } + } + + private function getEvents(array $posts) + { + $data = []; + foreach ($posts as $post) { + $meta = get_post_meta($post->ID, '', true); + $data[$post->ID] = [ + 'summary' => $post->post_title, + 'uid' => $meta['event-uid'], + 'description' => $meta['description'], + 'dstart' => $meta['start'], + 'dtend' => $meta['end'] + ]; + } + return $data; + } + + private function build(array $data) + { + // Setup calendar + $ics = new ICS($data); + + // Output .ics formatted text + $this->vcalendar = $ics->build(); + } + + private function stream() + { + $urlHost = parse_url(site_url(), PHP_URL_HOST); + $urlPath = parse_url(site_url(), PHP_URL_PATH); + $filename = sprintf( + '%1$s%2$s.ics', + $urlHost, + $urlPath ? '-' . $urlPath : '' + ); + + header('Content-Type: text/calendar; charset=' . get_option('blog_charset'), true); + header('Content-Disposition: attachment; filename=' . $filename); + echo $this->vcalendar; + exit; + } + + public static function makeIcsLink(array $args) + { + $args['ids'] = $args['ids'] ?? false; + $args['cats'] = $args['cats'] ?? false; + $args['tags'] = $args['tags'] ?? false; + $qArgs = ['ical-plugin' => plugin()->getSlug()]; + + foreach ($args as $k => $v) { + if ($v && is_array($v)) { + $qArgs = array_merge($qArgs, [$k => implode(',', $v)]); + } + } + + return add_query_arg($qArgs, site_url()); + } +} From b2ecbd067eee65c7c0e6951bda80254cdb409cd3 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Wed, 9 Aug 2023 15:19:58 +0200 Subject: [PATCH 09/17] Update ICS.php --- includes/ICS/ICS.php | 65 ++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php index bdda513a..949a508f 100644 --- a/includes/ICS/ICS.php +++ b/includes/ICS/ICS.php @@ -4,13 +4,11 @@ defined('ABSPATH') || exit; -use RRZE\Calendar\Utils; - class ICS { const DT_FORMAT = 'Ymd\THis\Z'; - protected $properties = []; + protected $data = []; private $availableProperties = [ 'uid', @@ -18,58 +16,71 @@ class ICS 'dtend', 'dtstart', 'location', - 'summary', - 'url' + 'summary' ]; - public function __construct($props) + public function __construct(array $data) + { + $this->setData($data); + } + + public function setData(array $data) { - $this->set($props); + foreach ($data as $k => $v) { + if (is_array($v)) { + $this->data[$k] = $this->setProps($v); + } + } } - public function set($key, $value = false) + public function setProps($key, string $value = '') { + $properties = []; if (is_array($key)) { foreach ($key as $k => $v) { - $this->set($k, $v); + $this->setProps($k, $v); } } else { if (in_array($key, $this->availableProperties)) { - $this->properties[$key] = $this->sanitizeValue($value, $key); + $properties[$key] = $this->sanitizeValue($value, $key); } } + return $properties; } - public function make() + public function build() { - $rows = $this->build(); + $rows = $this->render(); return implode("\r\n", $rows); } - private function build() + private function render() { + $locale = strtoupper(substr(get_locale(), 0, 2)); + $prodid = str_replace('.', '-', parse_url(site_url(), PHP_URL_HOST)) . '//Events//' . $locale; $icsProps = [ 'BEGIN:VCALENDAR', 'METHOD:PUBLISH', - 'PRODID:' . str_replace('.', '-', parse_url(site_url(), PHP_URL_HOST)) . '//Events', - 'VERSION:2.0', - 'BEGIN:VEVENT' + 'PRODID:' . $this->split($prodid), + 'VERSION:2.0' ]; - $props = []; - foreach ($this->properties as $k => $v) { - $props[strtoupper($k . ($k === 'url' ? ';VALUE=URI' : ''))] = $v; - } - - $props['DTSTAMP'] = $this->formatTimestamp('now'); - - foreach ($props as $k => $v) { - $icsProps[] = "$k:$v"; + if (!empty($this->data)) { + foreach ($this->data as $properties) { + $icsProps[] = 'BEGIN:VEVENT'; + $props = []; + foreach ($properties as $k => $v) { + $props[strtoupper($k)] = $v; + } + $props['DTSTAMP'] = $this->formatTimestamp('now'); + foreach ($props as $k => $v) { + $icsProps[] = "$k:$v"; + } + $icsProps[] = 'END:VEVENT'; + } } - $icsProps[] = 'END:VEVENT'; $icsProps[] = 'END:VCALENDAR'; - return $icsProps; } From c3e7a761cb83acafd2e9405cb25bf7f38d9c5284 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Wed, 9 Aug 2023 15:20:27 +0200 Subject: [PATCH 10/17] Update vendor files --- vendor/autoload.php | 2 +- vendor/composer/autoload_psr4.php | 1 - vendor/composer/autoload_real.php | 10 +- vendor/composer/autoload_static.php | 18 +- vendor/composer/installed.json | 55 -- vendor/composer/installed.php | 9 - vendor/jsvrcek/ics/.gitignore | 7 - vendor/jsvrcek/ics/.travis.yml | 19 - vendor/jsvrcek/ics/README.md | 146 ---- vendor/jsvrcek/ics/composer.json | 29 - vendor/jsvrcek/ics/phpunit.xml.dist | 28 - vendor/jsvrcek/ics/src/CalendarExport.php | 370 -------- vendor/jsvrcek/ics/src/CalendarStream.php | 96 --- vendor/jsvrcek/ics/src/Constants.php | 7 - .../src/Exception/CalendarEventException.php | 7 - .../ics/src/Exception/CalendarException.php | 7 - .../Exception/CalendarRecurrenceException.php | 7 - vendor/jsvrcek/ics/src/Model/Calendar.php | 396 --------- .../jsvrcek/ics/src/Model/CalendarAlarm.php | 243 ------ .../jsvrcek/ics/src/Model/CalendarEvent.php | 792 ------------------ .../ics/src/Model/CalendarFreeBusy.php | 7 - vendor/jsvrcek/ics/src/Model/CalendarTodo.php | 7 - .../ics/src/Model/Description/Conference.php | 104 --- .../jsvrcek/ics/src/Model/Description/Geo.php | 53 -- .../ics/src/Model/Description/Location.php | 75 -- .../Model/Recurrence/DataType/Frequency.php | 88 -- .../src/Model/Recurrence/DataType/Weekday.php | 89 -- .../Model/Recurrence/DataType/WeekdayNum.php | 74 -- .../src/Model/Recurrence/RecurrenceRule.php | 552 ------------ .../ics/src/Model/Relationship/Attendee.php | 439 ---------- .../ics/src/Model/Relationship/Organizer.php | 169 ---- vendor/jsvrcek/ics/src/Utility/Formatter.php | 169 ---- vendor/jsvrcek/ics/src/Utility/Provider.php | 146 ---- .../jsvrcek/ics/tests/CalendarExportTest.php | 432 ---------- .../jsvrcek/ics/tests/CalendarStreamTest.php | 57 -- .../ics/tests/Model/CalendarEventTest.php | 62 -- .../jsvrcek/ics/tests/Model/CalendarTest.php | 23 - .../Model/Recurrence/RecurrenceRuleTest.php | 84 -- .../tests/Model/Relationship/AttendeeTest.php | 36 - .../Model/Relationship/OrganizerTest.php | 29 - .../ics/tests/Utility/FormatterTest.php | 269 ------ .../ics/tests/Utility/ProviderTest.php | 119 --- vendor/jsvrcek/ics/tests/test-local-tz.ics | 108 --- vendor/jsvrcek/ics/tests/test-local.ics | 117 --- vendor/jsvrcek/ics/tests/test-utc.ics | 109 --- 45 files changed, 11 insertions(+), 5655 deletions(-) delete mode 100644 vendor/jsvrcek/ics/.gitignore delete mode 100644 vendor/jsvrcek/ics/.travis.yml delete mode 100644 vendor/jsvrcek/ics/README.md delete mode 100644 vendor/jsvrcek/ics/composer.json delete mode 100644 vendor/jsvrcek/ics/phpunit.xml.dist delete mode 100755 vendor/jsvrcek/ics/src/CalendarExport.php delete mode 100644 vendor/jsvrcek/ics/src/CalendarStream.php delete mode 100644 vendor/jsvrcek/ics/src/Constants.php delete mode 100644 vendor/jsvrcek/ics/src/Exception/CalendarEventException.php delete mode 100644 vendor/jsvrcek/ics/src/Exception/CalendarException.php delete mode 100644 vendor/jsvrcek/ics/src/Exception/CalendarRecurrenceException.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Calendar.php delete mode 100644 vendor/jsvrcek/ics/src/Model/CalendarAlarm.php delete mode 100755 vendor/jsvrcek/ics/src/Model/CalendarEvent.php delete mode 100644 vendor/jsvrcek/ics/src/Model/CalendarFreeBusy.php delete mode 100644 vendor/jsvrcek/ics/src/Model/CalendarTodo.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Description/Conference.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Description/Geo.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Description/Location.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Frequency.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Weekday.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Recurrence/DataType/WeekdayNum.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Recurrence/RecurrenceRule.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Relationship/Attendee.php delete mode 100644 vendor/jsvrcek/ics/src/Model/Relationship/Organizer.php delete mode 100644 vendor/jsvrcek/ics/src/Utility/Formatter.php delete mode 100644 vendor/jsvrcek/ics/src/Utility/Provider.php delete mode 100644 vendor/jsvrcek/ics/tests/CalendarExportTest.php delete mode 100644 vendor/jsvrcek/ics/tests/CalendarStreamTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Model/CalendarEventTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Model/CalendarTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Model/Recurrence/RecurrenceRuleTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Model/Relationship/AttendeeTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Model/Relationship/OrganizerTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Utility/FormatterTest.php delete mode 100644 vendor/jsvrcek/ics/tests/Utility/ProviderTest.php delete mode 100644 vendor/jsvrcek/ics/tests/test-local-tz.ics delete mode 100644 vendor/jsvrcek/ics/tests/test-local.ics delete mode 100644 vendor/jsvrcek/ics/tests/test-utc.ics diff --git a/vendor/autoload.php b/vendor/autoload.php index 26c3790b..fe03756b 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit1e6c2074e7b5370bfbea723e8399514c::getLoader(); +return ComposerAutoloaderInitd9af71ad6204b40402673742c70fad18::getLoader(); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index bcd87484..b621c647 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -9,5 +9,4 @@ 'RRule\\' => array($baseDir . '/src', $vendorDir . '/rlanvin/php-rrule/src'), 'RRZE\\WP\\' => array($vendorDir . '/rrze/wp/src'), 'RRZE\\Calendar\\' => array($baseDir . '/includes'), - 'Jsvrcek\\ICS\\' => array($vendorDir . '/jsvrcek/ics/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index c0f438fd..4ce6138f 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit1e6c2074e7b5370bfbea723e8399514c +class ComposerAutoloaderInitd9af71ad6204b40402673742c70fad18 { private static $loader; @@ -24,16 +24,16 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit1e6c2074e7b5370bfbea723e8399514c', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInitd9af71ad6204b40402673742c70fad18', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit1e6c2074e7b5370bfbea723e8399514c', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInitd9af71ad6204b40402673742c70fad18', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInitd9af71ad6204b40402673742c70fad18::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInitd9af71ad6204b40402673742c70fad18::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 4bb13e0d..90b6af8e 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c +class ComposerStaticInitd9af71ad6204b40402673742c70fad18 { public static $files = array ( 'e4e11a001002b1c747a45db4ce1ccc3a' => __DIR__ . '/..' . '/cmb2/cmb2/init.php', @@ -17,10 +17,6 @@ class ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c 'RRZE\\WP\\' => 8, 'RRZE\\Calendar\\' => 14, ), - 'J' => - array ( - 'Jsvrcek\\ICS\\' => 12, - ), ); public static $prefixDirsPsr4 = array ( @@ -37,10 +33,6 @@ class ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c array ( 0 => __DIR__ . '/../..' . '/includes', ), - 'Jsvrcek\\ICS\\' => - array ( - 0 => __DIR__ . '/..' . '/jsvrcek/ics/src', - ), ); public static $prefixesPsr0 = array ( @@ -61,10 +53,10 @@ class ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::$prefixesPsr0; - $loader->classMap = ComposerStaticInit1e6c2074e7b5370bfbea723e8399514c::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInitd9af71ad6204b40402673742c70fad18::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitd9af71ad6204b40402673742c70fad18::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInitd9af71ad6204b40402673742c70fad18::$prefixesPsr0; + $loader->classMap = ComposerStaticInitd9af71ad6204b40402673742c70fad18::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b73dda2f..6187ba05 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -129,61 +129,6 @@ ], "install-path": "../johngrogg/ics-parser" }, - { - "name": "jsvrcek/ics", - "version": "0.8.5", - "version_normalized": "0.8.5.0", - "source": { - "type": "git", - "url": "https://github.com/jasvrcek/ICS.git", - "reference": "11a24ac95648d720a1370c5bb20988b1739a63a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jasvrcek/ICS/zipball/11a24ac95648d720a1370c5bb20988b1739a63a4", - "reference": "11a24ac95648d720a1370c5bb20988b1739a63a4", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.5 || >=6.0" - }, - "time": "2023-01-17T22:16:11+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Jsvrcek\\ICS\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Svrcek", - "homepage": "https://github.com/jasvrcek" - } - ], - "description": "abstraction layer for creating multi-byte safe RFC 5545 compliant .ics files", - "homepage": "https://github.com/jasvrcek/ICS", - "keywords": [ - ".ics", - "RFC 5545", - "calendar", - "export", - "ical", - "multi-byte safe" - ], - "support": { - "issues": "https://github.com/jasvrcek/ICS/issues", - "source": "https://github.com/jasvrcek/ICS/tree/0.8.5" - }, - "install-path": "../jsvrcek/ics" - }, { "name": "rlanvin/php-rrule", "version": "v2.4.1", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 9998c378..f76abe09 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -28,15 +28,6 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'jsvrcek/ics' => array( - 'pretty_version' => '0.8.5', - 'version' => '0.8.5.0', - 'reference' => '11a24ac95648d720a1370c5bb20988b1739a63a4', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jsvrcek/ics', - 'aliases' => array(), - 'dev_requirement' => false, - ), 'rlanvin/php-rrule' => array( 'pretty_version' => 'v2.4.1', 'version' => '2.4.1.0', diff --git a/vendor/jsvrcek/ics/.gitignore b/vendor/jsvrcek/ics/.gitignore deleted file mode 100644 index 4cc11fd4..00000000 --- a/vendor/jsvrcek/ics/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.buildpath -.project -.settings -.idea -vendor -composer.lock -phpunit.xml diff --git a/vendor/jsvrcek/ics/.travis.yml b/vendor/jsvrcek/ics/.travis.yml deleted file mode 100644 index 1c6086a6..00000000 --- a/vendor/jsvrcek/ics/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - 8.0 - -sudo: false - -install: - - travis_retry composer install --no-interaction --prefer-source - -script: - - vendor/bin/phpunit - diff --git a/vendor/jsvrcek/ics/README.md b/vendor/jsvrcek/ics/README.md deleted file mode 100644 index c926c3d9..00000000 --- a/vendor/jsvrcek/ics/README.md +++ /dev/null @@ -1,146 +0,0 @@ -[![Build status](https://travis-ci.org/jasvrcek/ICS.svg?branch=master)](https://travis-ci.org/jasvrcek/ICS) - -ICS -=== - -Object-oriented php library for creating (and eventually reading) .ics iCal files. - -* This project does not yet support all functionality of the .ics format. - -## 1. Basic Usage - -```php -use Jsvrcek\ICS\Model\Calendar; -use Jsvrcek\ICS\Model\CalendarEvent; -use Jsvrcek\ICS\Model\Relationship\Attendee; -use Jsvrcek\ICS\Model\Relationship\Organizer; - -use Jsvrcek\ICS\Utility\Formatter; -use Jsvrcek\ICS\CalendarStream; -use Jsvrcek\ICS\CalendarExport; - -//setup an event -$eventOne = new CalendarEvent(); -$eventOne->setStart(new \DateTime()) - ->setSummary('Family reunion') - ->setUid('event-uid'); - -//add an Attendee -$attendee = new Attendee(new Formatter()); -$attendee->setValue('moe@example.com') - ->setName('Moe Smith'); -$eventOne->addAttendee($attendee); - -//set the Organizer -$organizer = new Organizer(new Formatter()); -$organizer->setValue('heidi@example.com') - ->setName('Heidi Merkell') - ->setLanguage('de'); -$eventOne->setOrganizer($organizer); - -//new event -$eventTwo = new CalendarEvent(); -$eventTwo->setStart(new \DateTime()) - ->setSummary('Dentist Appointment') - ->setUid('event-uid'); - -//setup calendar -$calendar = new Calendar(); -$calendar->setProdId('-//My Company//Cool Calendar App//EN') - ->addEvent($eventOne) - ->addEvent($eventTwo); - -//setup exporter -$calendarExport = new CalendarExport(new CalendarStream, new Formatter()); -$calendarExport->addCalendar($calendar); - -//output .ics formatted text -echo $calendarExport->getStream(); -``` - -## 2. Batch Event Provider - -The basic usage example will build the complete .ics string in memory and then echo it all -at once. This will use a lot of memory for a large calendar. The following example shows -how to make CalendarExport::getStream() output each line of the ics file as it is generated, as well as how to set a provider -for building the event list of a calendar in batches during export. - -```php -use Jsvrcek\ICS\Model\Calendar; -use Jsvrcek\ICS\Model\CalendarEvent; - -use Jsvrcek\ICS\Utility\Formatter; -use Jsvrcek\ICS\CalendarStream; -use Jsvrcek\ICS\CalendarExport; - -//setup calendar -$calendar = new Calendar(); -$calendar->setProdId('-//My Company//Cool Calendar App//EN'); - -//setup event provider to add events in batches during event iteration in $calendarExport->getStream() -$calendar->setEventsProvider(function ($startKey) use ($myDatabase) { - - //pseudo-code to get a batch of events from database - $eventDataArray = $myDatabase->getEventsBatch($startKey); - - $events = array(); - - foreach ($eventDataArray as $row) { - $event = new CalendarEvent(); - $event->setStart($row['start_date']) - ->setSummary($row['summary']) - ->setUid($row['event_uid']); - - $events[] = $event; - } - - return $events; -}); - -//setup exporter -$calendarExport = new CalendarExport(new CalendarStream, new Formatter()); -$calendarExport->addCalendar($calendar); - -//set exporter to send items directly to output instead of storing in memory -$calendarExport->getStreamObject()->setDoImmediateOutput(true); - -//output .ics formatted text -echo $calendarExport->getStream(); -``` - -## Todos - -* Jsvrcek\ICS\Model\CalendarTodo - -## Reference - - * http://tools.ietf.org/html/rfc5545 - -## Credits - - * Alex Balhatchet at [kaoru](https://github.com/kaoru) implemented CalendarAlarm. - * Thijs Wijnmaalen at [thijsw](https://github.com/thijsw/ics-large) provided inspiration on the batch provider code. - -## License - -The MIT License (MIT) - -Copyright (c) 2022 Justin Svrcek - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/jsvrcek/ics/composer.json b/vendor/jsvrcek/ics/composer.json deleted file mode 100644 index 7b6409fc..00000000 --- a/vendor/jsvrcek/ics/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "jsvrcek/ics", - "license": "MIT", - "description": "abstraction layer for creating multi-byte safe RFC 5545 compliant .ics files", - "keywords": ["ical", "calendar", "export", ".ics", "RFC 5545", "multi-byte safe"], - "homepage": "https://github.com/jasvrcek/ICS", - "authors": [ - { - "name": "Justin Svrcek", - "homepage": "https://github.com/jasvrcek" - } - ], - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^4.8 || ^5.5 || >=6.0" - }, - "autoload": { - "psr-4": { - "Jsvrcek\\ICS\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "Jsvrcek\\ICS\\Tests\\": "tests/" - } - } -} diff --git a/vendor/jsvrcek/ics/phpunit.xml.dist b/vendor/jsvrcek/ics/phpunit.xml.dist deleted file mode 100644 index 50126a10..00000000 --- a/vendor/jsvrcek/ics/phpunit.xml.dist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - ./tests - - - - - ./src - - - diff --git a/vendor/jsvrcek/ics/src/CalendarExport.php b/vendor/jsvrcek/ics/src/CalendarExport.php deleted file mode 100755 index 9961e6cc..00000000 --- a/vendor/jsvrcek/ics/src/CalendarExport.php +++ /dev/null @@ -1,370 +0,0 @@ -stream = $stream; - $this->formatter = $formatter; - } - - /** - * @return CalendarStream - */ - public function getStreamObject() - { - return $this->stream; - } - - /** - * @return string - * @throws \Exception - */ - public function getStream() - { - $this->stream->reset(); - - /* @var $cal Calendar */ - foreach ($this->getCalendars() as $cal) { - //start calendar - $this->stream->addItem('BEGIN:VCALENDAR') - ->addItem('VERSION:'.$cal->getVersion()) - ->addItem('PRODID:'.$cal->getProdId()) - ->addItem('CALSCALE:'.$cal->getCalendarScale()) - ->addItem('METHOD:'.$cal->getMethod()); - - if ($cal->getName()) { - $this->stream->addItem('NAME:'.$cal->getName()); - } - - if ($cal->getColor()) { - $this->stream->addItem('COLOR:'.$cal->getColor()); - } - - if ($cal->getImage()) { - $this->stream->addItem($this->formatter->getFormattedImageString($cal->getImage())); - } - - //custom headers - foreach ($cal->getCustomHeaders() as $key => $value) { - $this->stream->addItem($key.':'.$value); - } - - //timezone - $this->stream->addItem('BEGIN:VTIMEZONE'); - - $tz = $cal->getTimezone(); - - $calEvents = $cal->getEvents(); - - // Fallback to current year - $startYear = $endYear = date('Y'); - if ($calEvents->first() !== false) { - // Take first event as reference for timezone transitions - $firstEvent = $calEvents->first(); - $startYear = $firstEvent->getStart()->format('Y'); - $endYear = $firstEvent->getEnd()->format('Y'); - } - - $transitions = $tz->getTransitions(strtotime($startYear . '-01-01'), strtotime($endYear . '-12-31')); - - $daylightSavings = array( - 'exists' => false, - 'start' => '', - 'offsetTo' => '', - 'offsetFrom' => '' - ); - - $standard = array( - 'start' => '', - 'offsetTo' => '', - 'offsetFrom' => '' - ); - - foreach ($transitions as $transition) { - $varName = ($transition['isdst']) ? 'daylightSavings' : 'standard'; - - ${$varName}['exists'] = true; - if ($this->dateTimeFormat === 'local') { - ${$varName}['start'] = ':' . $this->formatter->getFormattedDateTime(new \DateTime($transition['time'])); - } else if ($this->dateTimeFormat === 'utc') { - ${$varName}['start'] = ':' . $this->formatter->getFormattedUTCDateTime(new \DateTime($transition['time'])); - } else if ($this->dateTimeFormat == 'local-tz') { - ${$varName}['start'] = ';' . $this->formatter->getFormattedDateTimeWithTimeZone(new \DateTime($transition['time'])); - } - - ${$varName}['offsetTo'] = $this->formatter->getFormattedTimeOffset($transition['offset']); - - //get previous offset - $previousTimezoneObservance = $transition['ts'] - 100; - $tzDate = new \DateTime('now', $tz); - $tzDate->setTimestamp($previousTimezoneObservance); - $offset = $tzDate->getOffset(); - - ${$varName}['offsetFrom'] = $this->formatter->getFormattedTimeOffset($offset); - } - - $this->stream->addItem('TZID:'.$tz->getName()); - - $this->stream->addItem('BEGIN:STANDARD') - ->addItem('DTSTART'.$standard['start']) - ->addItem('TZOFFSETTO:'.$standard['offsetTo']) - ->addItem('TZOFFSETFROM:'.$standard['offsetFrom']); - - if ($daylightSavings['exists']) { - $this->stream->addItem('RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU'); - } - $this->stream->addItem('END:STANDARD'); - - if ($daylightSavings['exists']) { - $this->stream->addItem('BEGIN:DAYLIGHT') - ->addItem('DTSTART'.$daylightSavings['start']) - ->addItem('TZOFFSETTO:'.$daylightSavings['offsetTo']) - ->addItem('TZOFFSETFROM:'.$daylightSavings['offsetFrom']) - ->addItem('RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU') - ->addItem('END:DAYLIGHT'); - } - - $this->stream->addItem('END:VTIMEZONE'); - - //add events - /* @var $event CalendarEvent */ - foreach ($cal->getEvents() as $event) { - - if ($event->isAllDay()) { - $dtStart = ':' . $this->formatter->getFormattedDate($event->getStart()); - $dtEnd = ':' . $this->formatter->getFormattedDate($event->getEnd()); - } else if ($this->dateTimeFormat === 'local') { - $dtStart = ':' . $this->formatter->getFormattedDateTime($event->getStart()); - $dtEnd = ':' . $this->formatter->getFormattedDateTime($event->getEnd()); - } else if ($this->dateTimeFormat === 'utc') { - $dtStart = ':' . $this->formatter->getFormattedUTCDateTime($event->getStart()); - $dtEnd = ':' . $this->formatter->getFormattedUTCDateTime($event->getEnd()); - } else if ($this->dateTimeFormat === 'local-tz'){ - $dtStart = ';' . $this->formatter->getFormattedDateTimeWithTimeZone($event->getStart()); - $dtEnd = ';' . $this->formatter->getFormattedDateTimeWithTimeZone($event->getEnd()); - } - - $this->stream->addItem('BEGIN:VEVENT') - ->addItem('UID:'.$event->getUid()) - ->addItem('DTSTART'. $dtStart) - ->addItem('DTEND'. $dtEnd); - - if ($event->getRecurrenceRule() instanceof RecurrenceRule) { - $this->stream->addItem($event->getRecurrenceRule()->__toString()); - } - - foreach ($event->getExceptionDates() as $date) { - $this->stream->addItem('EXDATE:'.$this->formatter->getFormattedDateTime($date)); - } - - if ($event->getSequence()) { - $this->stream->addItem('SEQUENCE:'.$event->getSequence()); - } - - if ($event->getTransp()) { - $this->stream->addItem('TRANSP:'.$event->getTransp()); - } - - if ($event->getColor()) { - $this->stream->addItem('COLOR:'.$event->getColor()); - } - - if ($event->getImage()) { - $this->stream->addItem($this->formatter->getFormattedImageString($event->getImage())); - } - - if ($event->getStatus()) { - $this->stream->addItem('STATUS:'.$event->getStatus()); - } - - $this->stream - ->addItem('SUMMARY:'.$event->getSummary()) - ->addItem('DESCRIPTION:'.$this->formatter->getEscapedText($event->getDescription())); - - if ($event->getClass()) { - $this->stream->addItem('CLASS:'.$event->getClass()); - } - - /* @var $location Location */ - foreach ($event->getLocations() as $location) { - $this->stream - ->addItem('LOCATION'.$location->getUri().$location->getLanguage().':'.$this->formatter->getEscapedText($location->getName())); - } - - if ($event->getPriority() > 0 && $event->getPriority() <= 9) { - $this->stream->addItem('PRIORITY:'.$event->getPriority()); - } - - if ($event->getGeo()) { - $this->stream->addItem('GEO:'.$event->getGeo()->getLatitude().';'.$event->getGeo()->getLongitude()); - } - - if ($event->getUrl()) { - $this->stream->addItem('URL:'.$event->getUrl()); - } - - - if ($event->getTimestamp()) { - $this->stream->addItem('DTSTAMP:'.$this->formatter->getFormattedUTCDateTime($event->getTimestamp())); - } else { - $this->stream->addItem('DTSTAMP:'.$this->formatter->getFormattedUTCDateTime(new \DateTime())); - } - - if ($event->getCreated()) { - $this->stream->addItem('CREATED:'.$this->formatter->getFormattedUTCDateTime($event->getCreated())); - } - - if ($event->getLastModified()) { - $this->stream->addItem('LAST-MODIFIED:'.$this->formatter->getFormattedUTCDateTime($event->getLastModified())); - } - - foreach ($event->getAttendees() as $attendee) { - $this->stream->addItem((string)$attendee); - } - - if ($event->getOrganizer()) { - $this->stream->addItem($event->getOrganizer()->__toString()); - } - - foreach ($event->getCustomProperties() as $key => $value) { - $this->stream->addItem($key.':'.$value); - } - - /** @var CalendarAlarm $alarm */ - foreach ($event->getAlarms() as $alarm) { - //basic requirements for all types of alarm - $this->stream->addItem('BEGIN:VALARM') - ->addItem($this->formatTrigger($alarm->getTrigger())) - ->addItem('ACTION:'.$alarm->getAction()); - - //only handle repeats if both repeat and duration are set - if ($alarm->getRepeat() && $alarm->getDuration()) { - $this->stream->addItem('REPEAT:'.$alarm->getRepeat()) - ->addItem('DURATION:'.$this->formatter->getFormattedDateInterval($alarm->getDuration())); - } - - //action specific logic - switch ($alarm->getAction()) { - case 'AUDIO': - $attachments = $alarm->getAttachments(); - $this->stream->addItem('ATTACH;'.$attachments[0]); - break; - case 'DISPLAY': - $this->stream->addItem('DESCRIPTION:'.$alarm->getDescription()); - break; - case 'EMAIL': - $this->stream->addItem('SUMMARY:'.$alarm->getSummary()) - ->addItem('DESCRIPTION:'.$alarm->getDescription()); - - foreach ($alarm->getAttendees() as $attendee) { - $this->stream->addItem((string)$attendee); - } - foreach ($alarm->getAttachments() as $attachment) { - $this->stream->addItem('ATTACH;'.$attachment); - } - break; - default: - throw new \Exception("Unknown ALARM action: '{$alarm->getAction()}'"); - break; - } - - $this->stream->addItem('END:VALARM'); - } - - foreach ($event->getConferences() as $conference) { - $this->stream->addItem($this->formatter->getConferenceText($conference)); - } - - $this->stream->addItem('END:VEVENT'); - } - - //end calendar - $this->stream->addItem('END:VCALENDAR'); - } - - return $this->stream->getStream(); - } - - - /** - * @return Calendar[] - */ - public function getCalendars() - { - return $this->calendars; - } - - /** - * @param array $calendars - * @return CalendarExport - */ - public function setCalendars(array $calendars) - { - $this->calendars = $calendars; - return $this; - } - - /** - * @param string $format - * @return $this - * @throws \Exception - */ - public function setDateTimeFormat($format) - { - if (in_array($format, ['local', 'local-tz', 'utc'])) { - $this->dateTimeFormat = $format; - } else { - throw new \Exception('Invalid Format Chosen'); - } - return $this; - - } - - /** - * @param Calendar $cal - * @return CalendarExport - */ - public function addCalendar(Calendar $cal) - { - $this->calendars[] = $cal; - return $this; - } - - private function formatTrigger($trigger) { - if ($trigger instanceof \DateInterval) { - return 'TRIGGER:-' . $this->formatter->getFormattedDateInterval($trigger); - } else { - return 'TRIGGER;VALUE=DATE-TIME:'.$this->formatter->getFormattedUTCDateTime($trigger); - } - } -} diff --git a/vendor/jsvrcek/ics/src/CalendarStream.php b/vendor/jsvrcek/ics/src/CalendarStream.php deleted file mode 100644 index eba09475..00000000 --- a/vendor/jsvrcek/ics/src/CalendarStream.php +++ /dev/null @@ -1,96 +0,0 @@ -doImmediateOutput = $doImmediateOutput; - } - - /** - * resets stream to blank string - */ - public function reset() - { - $this->stream = ''; - } - - /** - * @return string - */ - public function getStream() - { - return $this->stream; - } - - /** - * splits item into new lines if necessary - * @param string $item - * @return CalendarStream - */ - public function addItem($item) - { - // newlines need to be converted to literal \n - $item = str_replace("\n", "\\n", str_replace("\r\n", "\n", $item)); - - //get number of bytes - $length = strlen($item); - - $block = ''; - - if ($length > 75) { - $start = 0; - - while ($start < $length) { - $cut = mb_strcut($item, $start, self::LINE_LENGTH, 'UTF-8'); - $block .= $cut; - $start = $start + strlen($cut); - - //add space if not last line - if ($start < $length) { - $block .= Constants::CRLF.' '; - } - } - } else { - $block = $item; - } - - $this->stream .= $block.Constants::CRLF; - - if ($this->doImmediateOutput) { - echo $this; - $this->reset(); - } - - return $this; - } - - /** - * @return string - */ - public function __toString() - { - return $this->getStream(); - } -} diff --git a/vendor/jsvrcek/ics/src/Constants.php b/vendor/jsvrcek/ics/src/Constants.php deleted file mode 100644 index 7ab03c82..00000000 --- a/vendor/jsvrcek/ics/src/Constants.php +++ /dev/null @@ -1,7 +0,0 @@ -timezone = new \DateTimeZone('America/New_York'); - $this->events = new Provider(); - $this->todos = new Provider(); - $this->freeBusy = new Provider(); - } - - /** - * For use if you want CalendarExport::getStream to get events in batches from a database during - * the output of the ics feed, instead of adding all events to the Calendar object before outputting - * the ics feed. - * - CalendarExport::getStream iterates through the Calendar::$events internal data array. The $eventsProvider - * closure will be called every time this data array reaches its end during iteration, and the closure should - * return the next batch of events - * - A $startKey argument with the current key of the data array will be passed to the $eventsProvider closure - * - The $eventsProvider must return an array of CalendarEvent objects - * - * Example: Calendar::setEventsProvider(function($startKey){ - * //get database rows starting with $startKey - * //return an array of CalendarEvent objects - * }) - * - * @param \Closure $eventsProvider - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setEventsProvider(\Closure $eventsProvider) - { - $this->events = new Provider($eventsProvider); - return $this; - } - - /** - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * @param string $version - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setVersion($version) - { - $this->version = $version; - return $this; - } - - /** - * @return string - */ - public function getProdId() - { - return $this->prodId; - } - - /** - * @param string $prodId - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setProdId($prodId) - { - $this->prodId = $prodId; - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the RFC-7986 "Name" field for the calendar - * - * @param string $name - */ - public function setName($name) - { - $this->name = $name; - } - - /** - * @return string - */ - public function getCalendarScale() - { - return $this->calendarScale; - } - - /** - * @param string $calendarScale - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setCalendarScale($calendarScale) - { - $this->calendarScale = $calendarScale; - return $this; - } - - /** - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * @param string $method - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setMethod($method) - { - $this->method = $method; - return $this; - } - - /** - * @return array - */ - public function getImage() - { - return $this->image; - } - - /** - * Images can come in one of two formats: - * 1: URI - where a URI to the relevant image is provided - * 2: BINARY - Where a Binary representation of the image is provided, normally Base64 Encoded. - * - * If sending a URI for the image, set the "VALUE" key to be "URI" and provide a URI key with the relevant URI. - * IE: - * $calendar->setImage( - * 'VALUE' => 'URL', - * 'URI' => 'https://some.domain.com/path/to/image.jpg' - * ); - * It is optional to add a FMTTYPE key as well in the array, to indicate relevant mime type. - * IE: 'FMTTYPE' => 'image/jpg' - * - * When sending Binary version, you must provide the encoding type of the image, as well as the encoded string. - * IE: - * $calendar->setImage( - * 'VALUE' => 'BINARY', - * 'ENCODING' => 'BASE64', - * 'BINARY' => $base64_encoded_string - * ); - * For Binary, it is RECOMMENDED to add the FMTTYPE as well, but still not REQUIRED - * - * @param array $image - */ - public function setImage($image) - { - // Do some validation on provided data. - if (array_key_exists('VALUE', $image) && in_array($image['VALUE'], ['URI', 'BINARY'])) { - if ($image['VALUE'] == 'URI' && $image['URI']) { - $new_image = [ - 'VALUE' => 'URI', - 'URI' => $image['URI'] - ]; - - } elseif ($image['VALUE'] == 'BINARY' && $image['ENCODING'] && $image['BINARY']) { - $new_image = [ - 'VALUE' => 'BINARY', - 'ENCODING' => $image['ENCODING'], - 'BINARY' => $image['BINARY'] - ]; - } else { - return; - } - $new_image['DISPLAY'] = isset($image['DISPLAY']) ? $image['DISPLAY'] : ''; - $new_image['FMTTYPE'] = isset($image['FMTTYPE']) ? $image['FMTTYPE'] : ''; - $this->image = $new_image; - } - } - - /** - * @return array - */ - public function getCustomHeaders() - { - return $this->customHeaders; - } - - /** - * use to add custom headers as array key-value pairs
- * Example: $customHeaders = array('X-WR-TIMEZONE' => 'America/New_York') - * - * @param array $customHeaders - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setCustomHeaders(array $customHeaders) - { - $this->customHeaders = $customHeaders; - return $this; - } - - /** - * @param string $key - * @param string $value - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function addCustomHeader($key, $value) - { - $this->customHeaders[$key] = $value; - return $this; - } - - /** - * @return \DateTimeZone - */ - public function getTimezone() - { - return $this->timezone; - } - - /** - * @param \DateTimeZone $timezone - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setTimezone(\DateTimeZone $timezone) - { - $this->timezone = $timezone; - return $this; - } - - /** - * @return Provider - */ - public function getEvents() - { - return $this->events; - } - - /** - * @param CalendarEvent $event - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function addEvent(CalendarEvent $event) - { - $this->events->add($event); - return $this; - } - - /** - * @return Provider returs array of CalendarTodo objects - */ - public function getTodos() - { - return $this->todos; - } - - /** - * @param CalendarTodo $todo - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function addTodo(CalendarTodo $todo) - { - $this->todos[] = $todo; - return $this; - } - - /** - * @param array $todos - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setTodos(array $todos) - { - $this->todos = $todos; - return $this; - } - - /** - * @return Provider returs array of CalendarFreeBusy objects - */ - public function getFreeBusy() - { - return $this->freeBusy; - } - - /** - * @param CalendarFreeBusy $todo - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function addFreeBusy(CalendarFreeBusy $todo) - { - $this->freeBusy[] = $todo; - return $this; - } - - /** - * @param array $freeBusy - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setFreeBusy(array $freeBusy) - { - $this->freeBusy = $freeBusy; - return $this; - } - - /** - * @return string - */ - public function getColor() - { - return $this->color; - } - - - /** - * Set color as CSS3 string - * - * @param string $color - * @return \Jsvrcek\ICS\Model\Calendar - */ - public function setColor($color) - { - $this->color = $color; - return $this; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/CalendarAlarm.php b/vendor/jsvrcek/ics/src/Model/CalendarAlarm.php deleted file mode 100644 index c2610d58..00000000 --- a/vendor/jsvrcek/ics/src/Model/CalendarAlarm.php +++ /dev/null @@ -1,243 +0,0 @@ -action; - } - - /** - * @param string $action - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setAction($action) - { - $action = strtoupper($action); - $this->action = $action; - return $this; - } - - /** - * @return \DateTime|\DateInterval - */ - public function getTrigger() - { - return $this->trigger; - } - - /** - * @param \DateTime|\DateInterval $trigger - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setTrigger($trigger) - { - $this->trigger = $trigger; - return $this; - } - - /** - * @return array - */ - public function getAttachments() - { - return $this->attachments; - } - - /** - * @param array $attachments - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setAttachments($attachments) - { - $this->attachments = $attachments; - return $this; - } - - /** - * @param string $attachment - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function addAttachment($attachment) - { - $this->attachments[] = $attachment; - return $this; - } - - /** - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * @param string $description - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * @return string - */ - public function getSummary() - { - return $this->summary; - } - - /** - * @param string $summary - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setSummary($summary) - { - $this->summary = $summary; - return $this; - } - - /** - * @return array $attendees array of Attendee objects - */ - public function getAttendees() - { - return $this->attendees; - } - - /** - * @param array $attendees array of Attendee objects - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setAttendees(array $attendees) - { - $this->attendees = $attendees; - return $this; - } - - /** - * @param Attendee $attendee - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function addAttendee(Attendee $attendee) - { - $this->attendees[] = $attendee; - return $this; - } - - /** - * @return int - */ - public function getRepeat() - { - return $this->repeat; - } - - /** - * @param int $repeat - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setRepeat($repeat) - { - $this->repeat = $repeat; - return $this; - } - - /** - * @return \DateInterval - */ - public function getDuration() - { - return $this->duration; - } - - /** - * @param \DateInterval $duration - * @return \Jsvrcek\ICS\Model\CalendarAlarm - */ - public function setDuration($duration) - { - $this->duration = $duration; - return $this; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/CalendarEvent.php b/vendor/jsvrcek/ics/src/Model/CalendarEvent.php deleted file mode 100755 index 15ed7d93..00000000 --- a/vendor/jsvrcek/ics/src/Model/CalendarEvent.php +++ /dev/null @@ -1,792 +0,0 @@ -allDay; - } - - /** - * @param boolean $allDay - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setAllDay($allDay) - { - $this->allDay = $allDay; - return $this; - } - - /** - * @return string - */ - public function getUid() - { - return $this->uid; - } - - /** - * @param string $uid - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setUid($uid) - { - $this->uid = $uid; - return $this; - } - - /** - * @return \DateTime - */ - public function getStart() - { - return $this->start; - } - - /** - * also sets end time to 30 minutes after start as default
- * - end time can be overridden with setEnd() - * - * @param \DateTime $start - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setStart(\DateTime $start) - { - $this->start = $start; - $end = clone $start; - $this->setEnd($end->add(\DateInterval::createFromDateString('30 minutes'))); - return $this; - } - - /** - * @return \DateTime - */ - public function getEnd() - { - return $this->end; - } - - /** - * @param \DateTime $end - * @return CalendarEvent - * @throws CalendarEventException - */ - public function setEnd(\DateTime $end) - { - //check End is greater than Start - if ($this->getStart() instanceof \DateTime) { - if ($this->getStart() > $end) { - throw new CalendarEventException('End DateTime must be greater than Start DateTime'); - } - } else { - throw new CalendarEventException('You must set the Start time before setting the End Time of a CalendarEvent'); - } - - $this->end = $end; - return $this; - } - - /** - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function getRecurrenceRule() - { - return $this->recurrenceRule; - } - - /** - * @param RecurrenceRule $recurrenceRule - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setRecurrenceRule(RecurrenceRule $recurrenceRule) - { - $this->recurrenceRule = $recurrenceRule; - return $this; - } - - /** - * array of DateTime instances - * @param array $dates - * @return $this - */ - public function setExceptionDates(array $dates) - { - $this->exceptionDates = $dates; - return $this; - } - - /** - * @return array - */ - public function getExceptionDates() - { - return $this->exceptionDates; - } - - /** - * @param \DateTime $date - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function addExceptionDate(\DateTime $date) - { - $this->exceptionDates[] = $date; - return $this; - } - - /** - * @return string - */ - public function getSummary() - { - return $this->summary; - } - - /** - * @param string $summary - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setSummary($summary) - { - $this->summary = $summary; - return $this; - } - - /** - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * @param string $description - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * @return CalendarAlarm[] - */ - public function getAlarms() - { - return $this->alarms; - } - - /** - * @param CalendarAlarm $alarm - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function addAlarm(CalendarAlarm $alarm) - { - $this->alarms[] = $alarm; - return $this; - } - - /** - * @param array $alarms - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setAlarms(array $alarms) - { - $this->alarms = $alarms; - return $this; - } - - /** - * - * @return string - */ - public function getClass() - { - return $this->class; - } - - /** - * - * @param string $class - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setClass($class) - { - $this->class = $class; - return $this; - } - - /** - * - * @return \DateTime - */ - public function getCreated() - { - return $this->created; - } - - /** - * - * @param \DateTime $created - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setCreated(\DateTime $created) - { - $this->created = $created; - return $this; - } - - /** - * - * @return Geo|null - */ - public function getGeo() - { - return $this->geo; - } - - /** - * - * @param Geo $geo - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setGeo(Geo $geo) - { - $this->geo = $geo; - return $this; - } - - /** - * - * @return \DateTime - */ - public function getLastModified() - { - return $this->lastModified; - } - - /** - * - * @param \DateTime $lastModified - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setLastModified(\DateTime $lastModified) - { - $this->lastModified = $lastModified; - return $this; - } - - /** - * - * @return array $locations array of Location objects - */ - public function getLocations() - { - return $this->locations; - } - - /** - * - * @param array $locations array of Location objects - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setLocations(array $locations) - { - $this->locations = $locations; - return $this; - } - - /** - * - * @param Location $location - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function addLocation(Location $location) - { - $this->locations[] = $location; - return $this; - } - - /** - * - * @return Organizer - */ - public function getOrganizer() - { - return $this->organizer; - } - - /** - * - * @param Organizer $organizer - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setOrganizer(Organizer $organizer) - { - $this->organizer = $organizer; - return $this; - } - - /** - * - * @return string - */ - public function getPriority() - { - return $this->priority; - } - - /** - * - * @param string $priority - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setPriority($priority) - { - $this->priority = $priority; - return $this; - } - - /** - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->timestamp; - } - - /** - * - * @param \DateTime $timestamp - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setTimestamp(\DateTime $timestamp) - { - $this->timestamp = $timestamp; - return $this; - } - - /** - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * - * @param string $status - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * - * @return string - */ - public function getRecuringId() - { - return $this->recuringId; - } - - /** - * - * @param string $recuringId - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setRecuringId($recuringId) - { - $this->recuringId = $recuringId; - return $this; - } - - /** - * @return integer - */ - public function getSequence() - { - return $this->sequence; - } - - /** - * @param integer $sequence - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setSequence($sequence) - { - $this->sequence = $sequence; - return $this; - } - - /** - * - * @return array $attendees array of Attendee objects - */ - public function getAttendees() - { - return $this->attendees; - } - - /** - * - * @param array $attendees array of Attendee objects - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setAttendees(array $attendees) - { - $this->attendees = $attendees; - return $this; - } - - /** - * @param Attendee $attendee - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function addAttendee(Attendee $attendee) - { - $this->attendees[] = $attendee; - return $this; - } - - /** - * @param string $url - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setUrl($url) - { - $this->url = $url; - return $this; - } - - /** - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * @return string - */ - public function getTransp() - { - return $this->transp; - } - - /** - * Possible values are 'TRANSPARENT' or 'OPAQUE' - * - * @param string $transp - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setTransp($transp) - { - $this->transp = $transp; - return $this; - } - - /** - * @return array - */ - public function getImage() - { - return $this->image; - } - - /** - * Images can come in one of two formats: - * 1: URI - where a URI to the relevant image is provided - * 2: BINARY - Where a Binary representation of the image is provided, normally Base64 Encoded. - * - * If sending a URI for the image, set the "VALUE" key to be "URI" and provide a URI key with the relevant URI. - * IE: - * $calendar->setImage( - * 'VALUE' => 'URL', - * 'URI' => 'https://some.domain.com/path/to/image.jpg' - * ); - * It is optional to add a FMTTYPE key as well in the array, to indicate relevant mime type. - * IE: 'FMTTYPE' => 'image/jpg' - * - * When sending Binary version, you must provide the encoding type of the image, as well as the encoded string. - * IE: - * $calendar->setImage( - * 'VALUE' => 'BINARY', - * 'ENCODING' => 'BASE64', - * 'BINARY' => $base64_encoded_string - * ); - * For Binary, it is RECOMMENDED to add the FMTTYPE as well, but still not REQUIRED - * - * @param array $image - */ - public function setImage($image) - { - // Do some validation on provided data. - if (array_key_exists('VALUE', $image) && in_array($image['VALUE'], ['URI', 'BINARY'])) { - if ($image['VALUE'] == 'URI' && $image['URI']) { - $new_image = [ - 'VALUE' => 'URI', - 'URI' => $image['URI'] - ]; - - } elseif ($image['VALUE'] == 'BINARY' && $image['ENCODING'] && $image['BINARY']) { - $new_image = [ - 'VALUE' => 'BINARY', - 'ENCODING' => $image['ENCODING'], - 'BINARY' => $image['BINARY'] - ]; - } else { - return $this; - } - $new_image['DISPLAY'] = isset($image['DISPLAY']) ? $image['DISPLAY'] : ''; - $new_image['FMTTYPE'] = isset($image['FMTTYPE']) ? $image['FMTTYPE'] : ''; - $this->image = $new_image; - } - return $this; - } - - /** - * @return string - */ - public function getColor() - { - return $this->color; - } - - - /** - * Set color as CSS3 string - * - * @param string $color - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setColor($color) - { - $this->color = $color; - return $this; - } - - /** - * @return array - */ - public function getCustomProperties() - { - return $this->customProperties; - } - - /** - * use to add custom properties as array key-value pairs
- * Example: $customProperties = array('X-WR-TIMEZONE' => 'America/New_York') - * - * @param array $customProperties - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function setCustomProperties(array $customProperties) - { - $this->customProperties = $customProperties; - return $this; - } - - /** - * @param string $key - * @param string $value - * @return \Jsvrcek\ICS\Model\CalendarEvent - */ - public function addCustomProperty($key, $value) - { - $this->customProperties[$key] = $value; - return $this; - } - - /** - * @param Conference[] $conferences - * @return CalendarEvent - */ - public function setConferences(array $conferences) - { - $this->conferences = $conferences; - return $this; - } - - /** - * @param Conference $conference - * @return $this - */ - public function addConference(Conference $conference) - { - $this->conferences[] = $conference; - return $this; - } - - /** - * @return Conference[] - */ - public function getConferences() - { - return $this->conferences; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/CalendarFreeBusy.php b/vendor/jsvrcek/ics/src/Model/CalendarFreeBusy.php deleted file mode 100644 index 99dd801e..00000000 --- a/vendor/jsvrcek/ics/src/Model/CalendarFreeBusy.php +++ /dev/null @@ -1,7 +0,0 @@ -uri = $uri; - $this->label = isset($options['label']) ? $options['label'] : ''; - $this->feature = isset($options['feature']) ? $options['feature'] : ''; - $this->language = isset($options['language']) ? $options['language'] : ''; - } - - /** - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * @param string $language - */ - public function setLanguage($language) - { - $this->language = $language; - } - - /** - * @return string - */ - public function getFeature() - { - if (is_array($this->feature)) { - return implode(',', $this->feature); - } - return $this->feature; - } - - /** - * @param string|string[] $feature - */ - public function setFeature($feature) - { - $this->feature = $feature; - } - - /** - * @return string - */ - public function getLabel() - { - return $this->label; - } - - /** - * @param string $label - */ - public function setLabel($label) - { - $this->label = $label; - } - - /** - * @return string - */ - public function getUri() - { - return $this->uri; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Description/Geo.php b/vendor/jsvrcek/ics/src/Model/Description/Geo.php deleted file mode 100644 index 02932b60..00000000 --- a/vendor/jsvrcek/ics/src/Model/Description/Geo.php +++ /dev/null @@ -1,53 +0,0 @@ -latitude; - } - - /** - * @param float $latitude - * @return \Jsvrcek\ICS\Model\Description\Geo - */ - public function setLatitude($latitude) - { - $this->latitude = $latitude; - return $this; - } - - /** - * @return number - */ - public function getLongitude() - { - return $this->longitude; - } - - /** - * @param float $longitude - * @return \Jsvrcek\ICS\Model\Description\Geo - */ - public function setLongitude($longitude) - { - $this->longitude = $longitude; - return $this; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Description/Location.php b/vendor/jsvrcek/ics/src/Model/Description/Location.php deleted file mode 100644 index a1b8f829..00000000 --- a/vendor/jsvrcek/ics/src/Model/Description/Location.php +++ /dev/null @@ -1,75 +0,0 @@ -name; - } - - /** - * @param string $name - * @return \Jsvrcek\ICS\Model\Description\Location - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * @param string $uri uri to vCard or other uri - * @return \Jsvrcek\ICS\Model\Description\Location - */ - public function setUri($uri) - { - $this->uri = ';ALTREP="' . $uri . '"'; - return $this; - } - - /** - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * @param string $language RFC 1766 language identifier - * @return \Jsvrcek\ICS\Model\Description\Location - */ - public function setLanguage($language) - { - $this->language = ';LANGUAGE='.$language; - return $this; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Frequency.php b/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Frequency.php deleted file mode 100644 index 90c0948f..00000000 --- a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Frequency.php +++ /dev/null @@ -1,88 +0,0 @@ - 'SECONDLY', - self::MINUTELY => 'MINUTELY', - self::HOURLY => 'HOURLY', - self::DAILY => 'DAILY', - self::WEEKLY => 'WEEKLY', - self::MONTHLY => 'MONTHLY', - self::YEARLY => 'YEARLY' - ); - - /** - * @param integer $frequency Frequency::SECONDLY, Frequency::MINUTELY, - * Frequency::HOURLY, Frequency::DAILY, Frequency::WEEKLY, - * Frequency::MONTHLY, Frequency::YEARLY - */ - public function __construct($frequency) - { - $this->validateFrequency($frequency); - - $this->freq = $frequency; - } - - /** - * @return number - */ - public function getFreq() - { - return $this->freq; - } - - /** - * @param integer $freq - * @return \Jsvrcek\ICS\Model\Recurrence\DataType\Frequency - */ - public function setFreq($freq) - { - $this->validateFrequency($freq); - - $this->freq = $freq; - return $this; - } - - /** - * @param integer $frequency - * @throws CalendarRecurrenceException - */ - private function validateFrequency($frequency) - { - if (!is_int($frequency) || $frequency < 1 || $frequency > 7) { - throw new CalendarRecurrenceException('You must pass a Frequency constant to the contructor.'); - } - } - - /** - * @return string - */ - public function __toString() - { - return self::KEY.'='.self::$values[$this->freq]; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Weekday.php b/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Weekday.php deleted file mode 100644 index bd54dd93..00000000 --- a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/Weekday.php +++ /dev/null @@ -1,89 +0,0 @@ - 'SU', - self::MONDAY => 'MO', - self::TUESDAY => 'TU', - self::WEDNESDAY => 'WE', - self::THURSDAY => 'TH', - self::FRIDAY => 'FR', - self::SATURDAY => 'SA' - ); - - /** - * @param integer $weekday Weekday::SUNDAY, Weekday::MONDAY, - * Weekday::TUESDAY, Weekday::WEDNESDAY, Weekday::THURSDAY, - * Weekday::FRIDAY, Weekday::SATURDAY - */ - public function __construct($weekday) - { - $this->validateWeekday($weekday); - - $this->weekday = $weekday; - } - - /** - * @return number - */ - public function getWeekday() - { - return $this->weekday; - } - - /** - * @param integer $weekday - * @return \Jsvrcek\ICS\Model\Recurrence\DataType\Weekday - */ - public function setWeekday($weekday) - { - $this->validateWeekday($weekday); - - $this->weekday = $weekday; - return $this; - } - - /** - * @param integer $weekday - * @throws CalendarRecurrenceException - */ - private function validateWeekday($weekday) - { - if (!is_int($weekday) || $weekday < 1 || $weekday > 7) { - throw new CalendarRecurrenceException('You must pass a Weekday constant to the contructor.'); - } - } - - /** - * @return string - */ - public function __toString() - { - return $this->values[$this->weekday]; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/WeekdayNum.php b/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/WeekdayNum.php deleted file mode 100644 index c018745d..00000000 --- a/vendor/jsvrcek/ics/src/Model/Recurrence/DataType/WeekdayNum.php +++ /dev/null @@ -1,74 +0,0 @@ -validateWeekdayNum($weekdaynum); - $this->validateCountFromStartOrEnd($countFromStartOrEnd); - - $this->weekdaynum = $weekdaynum; - $this->countFromStartOrEnd = $countFromStartOrEnd; - } - - /* (non-PHPdoc) - * @see Jsvrcek\ICS\Model\Recurrence\DataType.Weekday::__toString() - */ - public function __toString() - { - return $this->countFromStartOrEnd.$this->weekdaynum.parent::__toString(); - } - - /** - * @param mixed $countFromStartOrEnd - * @throws CalendarRecurrenceException - */ - private function validateCountFromStartOrEnd($countFromStartOrEnd) - { - if ($countFromStartOrEnd !== self::COUNT_FROM_START && $countFromStartOrEnd !== self::COUNT_FROM_END) { - throw new CalendarRecurrenceException('You must use WeekdayNum::COUNT_FROM_START or WeekdayNum::COUNT_FROM_END'); - } - } - - /** - * @param integer $weekdaynum - * @throws CalendarRecurrenceException - */ - private function validateWeekdayNum($weekdaynum) - { - if (!is_int($weekdaynum) || $weekdaynum < 1 || $weekdaynum > 53) { - throw new CalendarRecurrenceException('$weekdaynum must be an integer between 1 and 53'); - } - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Recurrence/RecurrenceRule.php b/vendor/jsvrcek/ics/src/Model/Recurrence/RecurrenceRule.php deleted file mode 100644 index 3b45810f..00000000 --- a/vendor/jsvrcek/ics/src/Model/Recurrence/RecurrenceRule.php +++ /dev/null @@ -1,552 +0,0 @@ -formatter = $formatter; - } - - /** - * @return \Jsvrcek\ICS\Model\Recurrence\DataType\Frequency - */ - public function getFrequency() - { - return $this->frequency; - } - - /** - * @param Frequency $frequency - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setFrequency(Frequency $frequency) - { - $this->frequency = $frequency; - return $this; - } - - /** - * - * @return \DateTime - */ - public function getUntil() - { - return $this->until; - } - - /** - * Setting UNTIL will remove a COUNT if set - you cannot have both - * - * @param \DateTime $until = null - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setUntil(\DateTime $until = null) - { - $this->until = $until; - $this->count = null; - return $this; - } - - /** - * - * @return integer - */ - public function getCount() - { - return $this->count; - } - - - /** - * Setting a COUNT will remove the UNTIL date if set - you cannot have both - * - * @param integer $count - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setCount($count) - { - $this->validateInteger($count); - - $this->count = $count; - $this->until = null; - return $this; - } - - /** - * - * @return integer - */ - public function getInterval() - { - return $this->interval; - } - - /** - * @param integer $interval - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setInterval($interval) - { - $this->validateInteger($interval); - - $this->interval = $interval; - return $this; - } - - /** - * @return array - */ - public function getBySecondList() - { - return $this->bySecondList; - } - - /** - * @param array $bySecondList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setBySecondList(array $bySecondList) - { - $this->bySecondList = $bySecondList; - return $this; - } - - /** - * @param integer $integer 0-60 - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addBySecond($integer) - { - $this->validateInteger($integer); - - $this->bySecondList[] = $integer; - return $this; - } - - /** - * - * @return array - */ - public function getByMinuteList() - { - return $this->byMinuteList; - } - - /** - * @param array $byMinuteList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByMinuteList(array $byMinuteList) - { - $this->byMinuteList = $byMinuteList; - return $this; - } - - /** - * @param integer $integer 0-59 - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addByMinute($integer) - { - $this->validateInteger($integer); - - $this->byMinuteList[] = $integer; - return $this; - } - - /** - * - * @return array - */ - public function getByHourList() - { - return $this->byHourList; - } - - /** - * @param array $byHourList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByHourList(array $byHourList) - { - $this->byHourList = $byHourList; - return $this; - } - - /** - * @param integer $integer 0-23 - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addByHour($integer) - { - $this->validateInteger($integer); - - $this->byHourList[] = $integer; - return $this; - } - - /** - * - * @return array - */ - public function getByDayList() - { - return $this->byDayList; - } - - /** - * @param array $byDayList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByDayList(array $byDayList) - { - $this->byDayList = $byDayList; - return $this; - } - - /** - * @param WeekdayNum $weekdaynum - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addByDay(WeekdayNum $weekdaynum) - { - $this->byDayList[] = $weekdaynum; - return $this; - } - - /** - * - * @return array - */ - public function getByMonthDayList() - { - return $this->byMonthDayList; - } - - /** - * @param array $byMonthDayList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByMonthDayList(array $byMonthDayList) - { - $this->byMonthDayList = $byMonthDayList; - return $this; - } - - /** - * @param integer $integer - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addByMonthDay($integer) - { - $this->validateInteger($integer); - - $this->byMonthDayList[] = $integer; - return $this; - } - - /** - * - * @return array - */ - public function getByYearDayList() - { - return $this->byYearDayList; - } - - /** - * @param array $byYearDayList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByYearDayList(array $byYearDayList) - { - $this->byYearDayList = $byYearDayList; - return $this; - } - - /** - * - * @return array - */ - public function getByWeekNumberList() - { - return $this->byWeekNumberList; - } - - /** - * @param array $byWeekNumberList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByWeekNumberList(array $byWeekNumberList) - { - $this->byWeekNumberList = $byWeekNumberList; - return $this; - } - - /** - * @param integer $integer - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function addByMonth($integer) - { - $this->validateInteger($integer); - - $this->byMonthList[] = $integer; - return $this; - } - - /** - * - * @return array - */ - public function getByMonthList() - { - return $this->byMonthList; - } - - /** - * @param array $byMonthList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setByMonthList(array $byMonthList) - { - $this->byMonthList = $byMonthList; - return $this; - } - - /** - * - * @return array - */ - public function getBySetPosYearDayList() - { - return $this->bySetPosYearDayList; - } - - /** - * @param array $bySetPosYearDayList - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setBySetPosYearDayList(array $bySetPosYearDayList) - { - $this->bySetPosYearDayList = $bySetPosYearDayList; - return $this; - } - - /** - * - * @return Weekday - */ - public function getWeekStart() - { - return $this->weekStart; - } - - /** - * @param Weekday $weekStart - * @return \Jsvrcek\ICS\Model\Recurrence\RecurrenceRule - */ - public function setWeekStart(Weekday $weekStart) - { - $this->weekStart = $weekStart; - return $this; - } - - /** - * parses an RRULE string, hydrates self with values - * - * @param string $rRuleString - * @return RecurrenceRule - * @throws CalendarRecurrenceException - */ - public function parse($rRuleString) - { - //remove RRULE: - $string = str_replace(self::KEY, null, $rRuleString); - - $attributes = explode(';', $string); - - foreach ($attributes as $attribute) { - list($key, $value) = explode('=', $attribute); - - switch ($key) { - case Frequency::KEY: - if ($valueStringKey = array_search($value, Frequency::$values)) { - $this->setFrequency(new Frequency($valueStringKey)); - } else { - throw new CalendarRecurrenceException('Unsupported FREQ value in Recurrence Rule (RRULE) string: '.$value); - } - break; - - case 'INTERVAL': - $this->setInterval((int)$value); - break; - - case 'UNTIL': - $untilDate = new \DateTime(str_replace('Z', '', $value), new \DateTimeZone('UTC')); - $this->setUntil($untilDate); - break; - - case 'COUNT': - $this->setCount(intval($value)); - break; - - default: - throw new CalendarRecurrenceException('Unsupported attribute in Recurrence Rule (RRULE) string: '.$key); - } - } - - return $this; - } - - /** - * @return string - */ - public function __toString() - { - $items = array($this->getFrequency()->__toString()); - - if ($this->interval) { - $items[] = 'INTERVAL='.$this->interval; - } - - if ($this->until) { - $items[] = 'UNTIL='.$this->formatter->getFormattedUTCDateTime($this->until); - } - - if ($this->count) { - $items[] = 'COUNT='.$this->count; - } - - if ($this->byDayList) { - $items[] = 'BYDAY='.implode(',', $this->byDayList); - } - - if ($this->byMonthList) { - $items[] = 'BYMONTH='.implode(',', $this->byMonthList); - } - - if ($this->byMonthDayList) { - $items[] = 'BYMONTHDAY='.implode(',', $this->byMonthDayList); - } - - return self::KEY.implode(';', $items); - } - - /** - * @param integer $integer - * @throws CalendarRecurrenceException - */ - private function validateInteger($integer) - { - if (!is_int($integer)) { - throw new CalendarRecurrenceException('Value must be an integer'); - } - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Relationship/Attendee.php b/vendor/jsvrcek/ics/src/Model/Relationship/Attendee.php deleted file mode 100644 index 8e5cfd2c..00000000 --- a/vendor/jsvrcek/ics/src/Model/Relationship/Attendee.php +++ /dev/null @@ -1,439 +0,0 @@ -formatter = $formatter; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * RFC 5545 cal-address http://tools.ietf.org/html/rfc5545#section-3.3.3 - * @param string $uri - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setValue($uri) - { - $this->value = $this->formatter->getFormattedUri($uri); - return $this; - } - - /** - * @return string - */ - public function getCalendarUserType() - { - return $this->calendarUserType; - } - - /** - * RFC 5545 cutypeparam http://tools.ietf.org/html/rfc5545#section-3.2.3 - * - * @param string $calendarUserType - * "INDIVIDUAL" ; An individual
- * "GROUP" ; A group of individuals
- * "RESOURCE" ; A physical resource
- * "ROOM" ; A room resource
- * "UNKNOWN" ; Otherwise not known
- * x-name ; Experimental type
- * iana-token) ; Other IANA-registered type - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setCalendarUserType($calendarUserType) - { - $this->calendarUserType = $calendarUserType; - return $this; - } - - /** - * @return array - */ - public function getCalendarMembers() - { - return $this->calendarMembers; - } - - /** - * RFC 5545 memberparam http://tools.ietf.org/html/rfc5545#section-3.2.11 - * @param array $calendarMemberUris array of uri values for calendar users ex. array('sue@example.com', 'joe@example.com') - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setCalendarMembers($calendarMemberUris) - { - foreach ($calendarMemberUris as &$uri) { - $uri = $this->formatter->getFormattedUri($uri); - } - - $this->calendarMembers = $calendarMemberUris; - return $this; - } - - /** - * RFC 5545 memberparam http://tools.ietf.org/html/rfc5545#section-3.2.11 - * @param string $uri - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function addCalendarMember($uri) - { - $this->calendarMembers[] = $this->formatter->getFormattedUri($uri); - return $this; - } - - /** - * @return string - */ - public function getRole() - { - return $this->role; - } - - /** - * RFC 5545 roleparam http://tools.ietf.org/html/rfc5545#section-3.2.16 - * @param string $role - * "CHAIR" ; Indicates chair of the calendar entity
- * "REQ-PARTICIPANT" ; Indicates a participant whose participation is required
- * "OPT-PARTICIPANT" ; Indicates a participant whose participation is optional
- * "NON-PARTICIPANT" ; Indicates a participant who is copied for information purposes only
- * x-name ; Experimental role - * iana-token ; Other IANA role - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setRole($role) - { - $this->role = $role; - return $this; - } - - /** - * @return string - */ - public function getParticipationStatus() - { - return $this->participationStatus; - } - - /** - * RFC 5545 partstatparam http://tools.ietf.org/html/rfc5545#section-3.2.12 - * @param string $participationStatus - * Example values for an Event:
- * "NEEDS-ACTION" ; Event needs action
- * "ACCEPTED" ; Event accepted
- * "DECLINED" ; Event declined
- * "TENTATIVE" ; Event tentatively accepted
- * "DELEGATED" ; Event delegated - * - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setParticipationStatus($participationStatus) - { - $this->participationStatus = $participationStatus; - return $this; - } - - /** - * @return string - */ - public function getRsvp() - { - return $this->rsvp; - } - - /** - * RFC 5545 rsvpparam http://tools.ietf.org/html/rfc5545#section-3.2.17 - * @param string $rsvp "TRUE" or "FALSE" - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setRsvp($rsvp) - { - $this->rsvp = $rsvp; - return $this; - } - - /** - * @return array - */ - public function getDelegatedTo() - { - return $this->delegatedTo; - } - - /** - * RFC 5545 deltoparam http://tools.ietf.org/html/rfc5545#section-3.2.5 - * @param array $delegatedToUris array of uri values for calendar users ex. array('sue@example.com', 'joe@example.com') - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setDelegatedTo(array $delegatedToUris) - { - foreach ($delegatedToUris as &$uri) { - $uri = $this->formatter->getFormattedUri($uri); - } - - $this->delegatedTo = $delegatedToUris; - return $this; - } - - /** - * @param string $uri uri value for calendar users ex. 'mary@example.com' - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function addDelegatedTo($uri) - { - $this->delegatedTo[] = $this->formatter->getFormattedUri($uri); - return $this; - } - - /** - * @return array - */ - public function getDelegatedFrom() - { - return $this->delegatedFrom; - } - - /** - * RFC 5545 delfromparam http://tools.ietf.org/html/rfc5545#section-3.2.4 - * @param array $delegatedFromUris array of uri values for calendar users ex. array('sue@example.com', 'joe@example.com') - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setDelegatedFrom(array $delegatedFromUris) - { - foreach ($delegatedFromUris as &$uri) { - $uri = $this->formatter->getFormattedUri($uri); - } - - $this->delegatedFrom = $delegatedFromUris; - return $this; - } - - /** - * @param string $uri uri value for calendar users ex. 'mary@example.com' - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function addDelegatedFrom($uri) - { - $this->delegatedFrom[] = $this->formatter->getFormattedUri($uri); - return $this; - } - - /** - * @return string - */ - public function getSentBy() - { - return $this->sentBy; - } - - /** - * RFC 5545 sentbyparam http://tools.ietf.org/html/rfc5545#section-3.2.18 - * @param string $sentBy email address - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setSentBy($sentBy) - { - $this->sentBy = $sentBy; - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * RFC 5545 dirparam http://tools.ietf.org/html/rfc5545#section-3.2.6 - * @param string $directory uri directory entry associated with the calendar user - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setDirectory($directory) - { - $this->directory = $directory; - return $this; - } - - /** - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * @param string $language RFC 1766 language identifier - * @return \Jsvrcek\ICS\Model\Relationship\Attendee - */ - public function setLanguage($language) - { - $this->language = $language; - return $this; - } - - /** - * @return string - */ - public function __toString() - { - $string = 'ATTENDEE'; - - if ($this->calendarUserType) { - $string .= ';CUTYPE='.$this->calendarUserType; - } - - if (count($this->calendarMembers)) { - $string .= ';MEMBER="'.implode('","', $this->calendarMembers).'"'; - } - - if ($this->role) { - $string .= ';ROLE='.$this->role; - } - - if ($this->participationStatus) { - $string .= ';PARTSTAT='.$this->participationStatus; - } - - if ($this->rsvp) { - $string .= ';RSVP='.$this->rsvp; - } - - if (count($this->delegatedTo)) { - $string .= ';DELEGATED-TO="'.implode('","', $this->delegatedTo).'"'; - } - - if (count($this->delegatedFrom)) { - $string .= ';DELEGATED-FROM="'.implode('","', $this->delegatedFrom).'"'; - } - - if ($this->sentBy) { - $string .= ';SENT-BY="'.$this->sentBy.'"'; - } - - if ($this->name) { - $string .= ';CN='.$this->name; - } - - if ($this->directory) { - $string .= ';DIR="'.$this->directory.'"'; - } - - if ($this->language) { - $string .= ';LANGUAGE='.$this->language; - } - - $string .= ':'.$this->value; - - return $string; - } -} diff --git a/vendor/jsvrcek/ics/src/Model/Relationship/Organizer.php b/vendor/jsvrcek/ics/src/Model/Relationship/Organizer.php deleted file mode 100644 index 25a6f3e3..00000000 --- a/vendor/jsvrcek/ics/src/Model/Relationship/Organizer.php +++ /dev/null @@ -1,169 +0,0 @@ -formatter = $formatter; - } - - /** - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * RFC 5545 cal-address http://tools.ietf.org/html/rfc5545#section-3.3.3 - * @param string $uri - * @return \Jsvrcek\ICS\Model\Relationship\Organizer - */ - public function setValue($uri) - { - $this->value = $this->formatter->getFormattedUri($uri); - return $this; - } - - /** - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * @param string $name - * @return \Jsvrcek\ICS\Model\Relationship\Organizer - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * @return string - */ - public function getDirectory() - { - return $this->directory; - } - - /** - * RFC 5545 dirparam http://tools.ietf.org/html/rfc5545#section-3.2.6 - * @param string $directory uri directory entry associated with the calendar user - * @return \Jsvrcek\ICS\Model\Relationship\Organizer - */ - public function setDirectory($directory) - { - $this->directory = $directory; - return $this; - } - - /** - * @return string - */ - public function getSentBy() - { - return $this->sentBy; - } - - /** - * RFC 5545 sentbyparam http://tools.ietf.org/html/rfc5545#section-3.2.18 - * @param string $sentBy email address - * @return \Jsvrcek\ICS\Model\Relationship\Organizer - */ - public function setSentBy($sentBy) - { - $this->sentBy = $sentBy; - return $this; - } - - /** - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * @param string $language RFC 1766 language identifier - * @return \Jsvrcek\ICS\Model\Relationship\Organizer - */ - public function setLanguage($language) - { - $this->language = $language; - return $this; - } - - public function __toString() - { - $string = 'ORGANIZER'; - - if ($this->sentBy) { - $string .= ';SENT-BY="'.$this->sentBy.'"'; - } - - if ($this->name) { - $string .= ';CN='.$this->name; - } - - if ($this->directory) { - $string .= ';DIR="'.$this->directory.'"'; - } - - if ($this->language) { - $string .= ';LANGUAGE='.$this->language; - } - - $string .= ':'.$this->value; - - return $string; - } -} diff --git a/vendor/jsvrcek/ics/src/Utility/Formatter.php b/vendor/jsvrcek/ics/src/Utility/Formatter.php deleted file mode 100644 index e47a5239..00000000 --- a/vendor/jsvrcek/ics/src/Utility/Formatter.php +++ /dev/null @@ -1,169 +0,0 @@ -format(self::DATE_TIME); - } - - /** - * @param int $offset - * @return string - */ - public function getFormattedTimeOffset($offset) - { - $prefix = ($offset < 0) ? '-' : '+'; - - return $prefix.gmdate('Hi', abs($offset)); - } - - /** - * @param \DateTime $dateTime - * @return string - */ - public function getFormattedUTCDateTime(\DateTime $dateTime) - { - return $dateTime->setTimezone(new \DateTimeZone('UTC')) - ->format(self::DATE_TIME_UTC); - } - - /** - * @param \DateTime $dateTime - * @return string - */ - public function getFormattedDateTimeWithTimeZone(\DateTime $dateTime) { - return 'TZID=' . $dateTime->getTimezone()->getName() . ':' . self::getFormattedDateTime($dateTime); - } - - /** - * @param \DateTime $dateTime - * @return string - */ - public function getFormattedDate(\DateTime $dateTime) - { - return $dateTime->format(self::DATE); - } - - /** - * converts email addresses into mailto: uri - * @param string $uri - * @return string - */ - public function getFormattedUri($uri) - { - if (strpos($uri, '@') && stripos($uri, 'mailto:') === false) { - $uri = 'mailto:'.$uri; - } - - return $uri; - } - - /** - * converts DateInterval object to string that can be used for a VALARM DURATION - * @param \DateInterval $interval - * @return string - */ - public function getFormattedDateInterval(\DateInterval $interval) - { - $format = "P"; - - if ($interval->y) { - $format .= '%yY'; - } - if ($interval->m) { - $format .= '%mM'; - } - if ($interval->d) { - $format .= '%dD'; - } - - if ($interval->h || $interval->i || $interval->s) { - $format .= "T"; - } - - if ($interval->h) { - $format .= '%hH'; - } - if ($interval->i) { - $format .= '%iM'; - } - if ($interval->s) { - $format .= '%sS'; - } - - return $interval->format($format); - } - - /** - * converts an image array into a correctly formatted string. - * @param array $image - * @return string - */ - public function getFormattedImageString(array $image) - { - $imageString = 'IMAGE;VALUE='.$image['VALUE']; - if ($image['VALUE'] == 'BINARY'){ - $imageString .= ';ENCODING=' . $image['ENCODING']; - } - - if (isset($image['DISPLAY'])) { - $imageString .= ';DISPLAY=' . $image['DISPLAY']; - } - if (isset($image['FMTTYPE'])) { - $imageString .= ';FMTTYPE=' . $image['FMTTYPE']; - } - if ($image['VALUE'] == 'URI') { - $imageString .= ':' . $image['URI']; - } else { - $imageString .= ':' . $image['BINARY']; - } - return $imageString; - - } - - /** - * Escapes , and ; characters in text type fields. - * - * @param string $text The text to escape - * @return string - */ - public function getEscapedText($text) - { - if ($text) - { - $text = preg_replace('/((?getFeature()) { - $text .= ';FEATURE=' . $conference->getFeature(); - } - if ($conference->getLabel()) { - $text .= ';LABEL=' . $this->getEscapedText($conference->getLabel()); - } - if ($conference->getLanguage()) { - $text .= ';LANGUAGE=' . $this->getEscapedText($conference->getLanguage()); - } - $text .= ':' . $conference->getUri(); - return $text; - } -} diff --git a/vendor/jsvrcek/ics/src/Utility/Provider.php b/vendor/jsvrcek/ics/src/Utility/Provider.php deleted file mode 100644 index b69bf4b4..00000000 --- a/vendor/jsvrcek/ics/src/Utility/Provider.php +++ /dev/null @@ -1,146 +0,0 @@ -provider = $provider; - } - - /** - * for manually adding items, rather than using a provider closure to add items in batches during iteration - * Cannot be used in conjunction with a provider closure! - * - * @param mixed $item - * @return void - */ - public function add($item) - { - $this->manuallyAddedData[] = $item; - } - - /** - * @see Iterator::current() - * @return false|mixed - */ - #[\ReturnTypeWillChange] - public function current() - { - return current($this->data); - } - - /** - * @see Iterator::key() - * @return float|int|null - */ - #[\ReturnTypeWillChange] - public function key() - { - return $this->key; - } - - /** - * @see Iterator::next() - * @return void - */ - #[\ReturnTypeWillChange] - public function next() - { - array_shift($this->data); - $this->key++; - } - - /** - * @see Iterator::rewind() - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - $this->data = array(); - $this->key = 0; - } - - /** - * get next batch from provider if data array is at the end - * - * @see Iterator::valid() - * @return bool - */ - #[\ReturnTypeWillChange] - public function valid() - { - if (count($this->data) < 1) { - if ($this->provider instanceof \Closure) { - $this->data = $this->provider->__invoke($this->key); - if (isset($this->data[0])) { - $this->first = $this->data[0]; - } - } else { - $this->data = $this->manuallyAddedData; - $this->manuallyAddedData = array(); - } - } - - return count($this->data) > 0; - } - - /** - * Returns first event - * - * @return false|mixed - */ - public function first() - { - if (isset($this->first)) { - return $this->first; - } - - if ($this->provider instanceof \Closure) { - if ($this->valid()) { - return $this->first; - } else { - return false; - } - } - - if (!isset($this->manuallyAddedData[0])) { - return false; - } - - return $this->manuallyAddedData[0]; - } -} diff --git a/vendor/jsvrcek/ics/tests/CalendarExportTest.php b/vendor/jsvrcek/ics/tests/CalendarExportTest.php deleted file mode 100644 index ac304712..00000000 --- a/vendor/jsvrcek/ics/tests/CalendarExportTest.php +++ /dev/null @@ -1,432 +0,0 @@ -setValue('sue@example.com') - ->setName('Sue Jones') - ->setSentBy('mary@example.com') - ->setLanguage('en'); - - $attendee = new Attendee(new Formatter()); - $attendee->setName('Jane Smith') - ->setCalendarUserType('INDIVIDUAL') - ->setParticipationStatus('ACCEPTED') - ->setRole('REQ-PARTICIPANT') - ->setSentBy('joe@example') - ->addCalendarMember('list@example.com') - ->setValue('jane-smith@example.com'); - - $conference1 = new Conference('tel:+1-412-555-0123,,,654321'); - $conference2 = new Conference( - 'https://chat.example.com/audio?id=123456', - [ - 'feature' => ['AUDIO', 'VIDEO'], - 'label' => 'Attendee dial-in' - ] - ); - $conference3 = new Conference( - 'xmpp:chat-123@conference.example.com', - [ - 'feature' => 'CHAT', - 'label' => 'Chat Room', - 'language' => 'en:Germany' - ] - ); - $conferenceDetails = [ - $conference1, - $conference2 - ]; - - $event = new CalendarEvent(); - $event->setUid('lLKjd89283oja89282lkjd8@example.com') - ->setStart(new \DateTime('4 October 2013 12:00:00', $timezone)) - ->setEnd(new \DateTime('4 October 2013 22:00:00', $timezone)) - ->setSummary('Poker night at the South Pole') - ->addAttendee($attendee) - ->setOrganizer($organizer) - ->setSequence(3) - ->setTransp('TRANSPARENT') - ->setColor('red') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)) - ->setConferences($conferenceDetails) - ->addConference($conference3); - - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::MONTHLY)) - ->setInterval(2) - ->setCount(40) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 1)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 2)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 3)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 4)) - ->addByDay(new WeekdayNum(Weekday::FRIDAY, 1)); - $event->setRecurrenceRule($rrule); - - //add an alarms to this event - $alarmAudio = new CalendarAlarm(); - $alarmAudio->setAction("audio"); - $alarmAudio->setTrigger($event->getStart()); - $alarmAudio->addAttachment("FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud"); - $event->addAlarm($alarmAudio); - - $alarmDisplay = new CalendarAlarm(); - $alarmDisplay->setAction("display"); - $alarmDisplay->setTrigger($event->getStart()); - $alarmDisplay->setRepeat(3); - $alarmDisplay->setDuration(new \DateInterval('PT15M')); - $alarmDisplay->setDescription("DESCRIPTION"); - $event->addAlarm($alarmDisplay); - - $alarmEmail = new CalendarAlarm(); - $alarmEmail->setAction('email'); - $alarmEmail->setTrigger($event->getStart()); - $alarmEmail->addAttendee($attendee); - $alarmEmail->setSummary("EMAIL SUBJECT"); - $alarmEmail->setDescription("EMAIL BODY"); - $alarmEmail->addAttachment("FMTTYPE=application/msword:http://example.com/agenda.docx"); - $alarmEmail->addAttachment("FMTTYPE=application/pdf:http://example.com/agenda.pdf"); - $event->addAlarm($alarmEmail); - - //test exception dates - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('eventtwo@example.com') - ->setStart(new \DateTime('2 October 2013', $timezone)) - ->setSummary('Every Wednesday event') - ->addCustomProperty('FOO', 'bar') - ->addCustomProperty('BAR', 'baz') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::WEEKLY)); - - $eventTwo->setRecurrenceRule($rrule); - - //add exception dates to the event recurrence - $eventTwo->addExceptionDate(new \DateTime('16 October 2013', $timezone)) - ->addExceptionDate(new \DateTime('30 October 2013', $timezone)); - - $cal = new Calendar(); - $cal->setProdId('-//Jsvrcek//ICS//EN') - ->setTimezone($timezone) - ->addEvent($event) - ->addEvent($eventTwo); - - //create second calendar using batch event provider - $timezone = new \DateTimeZone('Arctic/Longyearbyen'); - $calTwo = new Calendar(); - $calTwo->setProdId('-//Jsvrcek//ICS//EN2') - ->setColor('green') - ->setTimezone($timezone); - - $calTwo->setEventsProvider(function ($start) use ($timezone) { - $eventOne = new CalendarEvent(); - $eventOne->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-01 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setSummary('A long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-03 01:01:01', $timezone)) - ->setSummary('Another long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - return ($start > 0) ? array() : array($eventOne, $eventTwo); - }); - - $ce = new CalendarExport(new CalendarStream(), new Formatter()); - $ce->addCalendar($cal) - ->addCalendar($calTwo); - - $stream = $ce->getStream(); - - $expected = file_get_contents(__DIR__ . '/test-local.ics'); - - $this->assertEquals($expected, $stream); - } - - public function testGetStreamUTC() - { - $timezone = new \DateTimeZone('Antarctica/McMurdo'); - - $organizer = new Organizer(new Formatter()); - $organizer->setValue('sue@example.com') - ->setName('Sue Jones') - ->setSentBy('mary@example.com') - ->setLanguage('en'); - - $attendee = new Attendee(new Formatter()); - $attendee->setName('Jane Smith') - ->setCalendarUserType('INDIVIDUAL') - ->setParticipationStatus('ACCEPTED') - ->setRole('REQ-PARTICIPANT') - ->setSentBy('joe@example') - ->addCalendarMember('list@example.com') - ->setValue('jane-smith@example.com'); - - $event = new CalendarEvent(); - $event->setUid('lLKjd89283oja89282lkjd8@example.com') - ->setStart(new \DateTime('4 October 2013 12:00:00', $timezone)) - ->setEnd(new \DateTime('4 October 2013 22:00:00', $timezone)) - ->setSummary('Poker night at the South Pole') - ->setStatus('CONFIRMED') - ->addAttendee($attendee) - ->setOrganizer($organizer) - ->setSequence(3) - ->setTransp('TRANSPARENT') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::MONTHLY)) - ->setInterval(2) - ->setCount(40) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 1)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 2)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 3)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 4)) - ->addByDay(new WeekdayNum(Weekday::FRIDAY, 1)); - $event->setRecurrenceRule($rrule); - - //add an alarms to this event - $alarmAudio = new CalendarAlarm(); - $alarmAudio->setAction("audio"); - $alarmAudio->setTrigger($event->getStart()); - $alarmAudio->addAttachment("FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud"); - $event->addAlarm($alarmAudio); - - $alarmDisplay = new CalendarAlarm(); - $alarmDisplay->setAction("display"); - $alarmDisplay->setTrigger($event->getStart()); - $alarmDisplay->setRepeat(3); - $alarmDisplay->setDuration(new \DateInterval('PT15M')); - $alarmDisplay->setDescription("DESCRIPTION"); - $event->addAlarm($alarmDisplay); - - $alarmEmail = new CalendarAlarm(); - $alarmEmail->setAction('email'); - $alarmEmail->setTrigger($event->getStart()); - $alarmEmail->addAttendee($attendee); - $alarmEmail->setSummary("EMAIL SUBJECT"); - $alarmEmail->setDescription("EMAIL BODY"); - $alarmEmail->addAttachment("FMTTYPE=application/msword:http://example.com/agenda.docx"); - $alarmEmail->addAttachment("FMTTYPE=application/pdf:http://example.com/agenda.pdf"); - $event->addAlarm($alarmEmail); - - //test exception dates - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('eventtwo@example.com') - ->setStart(new \DateTime('2 October 2013', $timezone)) - ->setSummary('Every Wednesday event') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::WEEKLY)); - - $eventTwo->setRecurrenceRule($rrule); - - //add exception dates to the event recurrence - $eventTwo->addExceptionDate(new \DateTime('16 October 2013', $timezone)) - ->addExceptionDate(new \DateTime('30 October 2013', $timezone)); - - $cal = new Calendar(); - $cal->setProdId('-//Jsvrcek//ICS//EN') - ->setTimezone($timezone) - ->addEvent($event) - ->addEvent($eventTwo); - - //create second calendar using batch event provider - $timezone = new \DateTimeZone('Arctic/Longyearbyen'); - $calTwo = new Calendar(); - $calTwo->setProdId('-//Jsvrcek//ICS//EN2') - ->setTimezone($timezone); - - $calTwo->setEventsProvider(function ($start) use ($timezone) { - $eventOne = new CalendarEvent(); - $eventOne->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-01 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setSummary('A long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-03 01:01:01', $timezone)) - ->setSummary('Another long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - return ($start > 0) ? array() : array($eventOne, $eventTwo); - }); - - $ce = new CalendarExport(new CalendarStream(), new Formatter()); - $ce->addCalendar($cal) - ->addCalendar($calTwo) - ->setDateTimeFormat('utc'); - - $stream = $ce->getStream(); - - $expected = file_get_contents(__DIR__ . '/test-utc.ics'); - - $this->assertEquals($expected, $stream); - } - - public function testGetStreamTZAndLocal() - { - $timezone = new \DateTimeZone('Antarctica/McMurdo'); - - $organizer = new Organizer(new Formatter()); - $organizer->setValue('sue@example.com') - ->setName('Sue Jones') - ->setSentBy('mary@example.com') - ->setLanguage('en'); - - $attendee = new Attendee(new Formatter()); - $attendee->setName('Jane Smith') - ->setCalendarUserType('INDIVIDUAL') - ->setParticipationStatus('ACCEPTED') - ->setRole('REQ-PARTICIPANT') - ->setSentBy('joe@example') - ->addCalendarMember('list@example.com') - ->setValue('jane-smith@example.com'); - - $event = new CalendarEvent(); - $event->setUid('lLKjd89283oja89282lkjd8@example.com') - ->setStart(new \DateTime('4 October 2013 12:00:00', $timezone)) - ->setEnd(new \DateTime('4 October 2013 22:00:00', $timezone)) - ->setSummary('Poker night at the South Pole') - ->addAttendee($attendee) - ->setOrganizer($organizer) - ->setSequence(3) - ->setTransp('TRANSPARENT') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::MONTHLY)) - ->setInterval(2) - ->setCount(40) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 1)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 2)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 3)) - ->addByDay(new WeekdayNum(Weekday::SATURDAY, 4)) - ->addByDay(new WeekdayNum(Weekday::FRIDAY, 1)); - $event->setRecurrenceRule($rrule); - - //add an alarms to this event - $alarmAudio = new CalendarAlarm(); - $alarmAudio->setAction("audio"); - $alarmAudio->setTrigger($event->getStart()); - $alarmAudio->addAttachment("FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud"); - $event->addAlarm($alarmAudio); - - $alarmDisplay = new CalendarAlarm(); - $alarmDisplay->setAction("display"); - $alarmDisplay->setTrigger($event->getStart()); - $alarmDisplay->setRepeat(3); - $alarmDisplay->setDuration(new \DateInterval('PT15M')); - $alarmDisplay->setDescription("DESCRIPTION"); - $event->addAlarm($alarmDisplay); - - $alarmEmail = new CalendarAlarm(); - $alarmEmail->setAction('email'); - $alarmEmail->setTrigger($event->getStart()); - $alarmEmail->addAttendee($attendee); - $alarmEmail->setSummary("EMAIL SUBJECT"); - $alarmEmail->setDescription("EMAIL BODY"); - $alarmEmail->addAttachment("FMTTYPE=application/msword:http://example.com/agenda.docx"); - $alarmEmail->addAttachment("FMTTYPE=application/pdf:http://example.com/agenda.pdf"); - $event->addAlarm($alarmEmail); - - //test exception dates - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('eventtwo@example.com') - ->setStart(new \DateTime('2 October 2013', $timezone)) - ->setSummary('Every Wednesday event') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $rrule = new RecurrenceRule(new Formatter()); - $rrule->setFrequency(new Frequency(Frequency::WEEKLY)); - - $eventTwo->setRecurrenceRule($rrule); - - //add exception dates to the event recurrence - $eventTwo->addExceptionDate(new \DateTime('16 October 2013', $timezone)) - ->addExceptionDate(new \DateTime('30 October 2013', $timezone)); - - $cal = new Calendar(); - $cal->setProdId('-//Jsvrcek//ICS//EN') - ->setTimezone($timezone) - ->addEvent($event) - ->addEvent($eventTwo); - - //create second calendar using batch event provider - $timezone = new \DateTimeZone('Arctic/Longyearbyen'); - $calTwo = new Calendar(); - $calTwo->setProdId('-//Jsvrcek//ICS//EN2') - ->setTimezone($timezone); - - $calTwo->setEventsProvider(function ($start) use ($timezone) { - $eventOne = new CalendarEvent(); - $eventOne->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-01 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setSummary('A long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - $eventTwo = new CalendarEvent(); - $eventTwo->setUid('asdfasdf@example.com') - ->setStart(new \DateTime('2016-01-02 01:01:01', $timezone)) - ->setEnd(new \DateTime('2016-01-03 01:01:01', $timezone)) - ->setSummary('Another long day') - ->setTimestamp(new \DateTime('1 September 2013', $timezone)); - - return ($start > 0) ? array() : array($eventOne, $eventTwo); - }); - - $ce = new CalendarExport(new CalendarStream(), new Formatter()); - $ce->addCalendar($cal) - ->addCalendar($calTwo) - ->setDateTimeFormat('local-tz'); - - $stream = $ce->getStream(); - - $expected = file_get_contents(__DIR__ . '/test-local-tz.ics'); - - $this->assertEquals($expected, $stream); - } -} diff --git a/vendor/jsvrcek/ics/tests/CalendarStreamTest.php b/vendor/jsvrcek/ics/tests/CalendarStreamTest.php deleted file mode 100644 index 117f0eef..00000000 --- a/vendor/jsvrcek/ics/tests/CalendarStreamTest.php +++ /dev/null @@ -1,57 +0,0 @@ -assertEquals('', $s->getStream()); - } - - public function testAddItemToStream() - { - //simple test - $s = new CalendarStream(); - $item = 'TEST'; - $expected = 'TEST'.Constants::CRLF; - $s->addItem($item); - $this->assertEquals($expected, $s->getStream()); - - //long string test - $s = new CalendarStream(); - $item = ' aaaaaaa10 aaaaaaa20 aaaaaaa30 aaaaaaa40 aaaaaaa50 aaaaaaa60 aaaaaaa70 aaaaaaa80 aaaaaaa90'; - $expected = ' aaaaaaa10 aaaaaaa20 aaaaaaa30 aaaaaaa40 aaaaaaa50 aaaaaaa60 aaaaaaa70'.Constants::CRLF.' '.' aaaaaaa80 aaaaaaa90'.Constants::CRLF; - $s->addItem($item); - $this->assertEquals($expected, $s->getStream()); - - $s = new CalendarStream(); - $item = ' ëëëë1 ëëëë2 ëëëë3 ëëëë4 ëëëë5 ëëëë6 ëëëëëëëëë8 ëëëë9'; - $expected = ' ëëëë1 ëëëë2 ëëëë3 ëëëë4 ëëëë5 ëëëë6 ëëëë'.Constants::CRLF.' '.'ëëëëë8 ëëëë9'.Constants::CRLF; - $s->addItem($item); - $this->assertEquals($expected, $s->getStream()); - } - - public function testReset() - { - $s = new CalendarStream(); - $item = 'TEST'; - $s->addItem($item); - $s->reset(); - $this->assertEquals('', $s->getStream()); - } - - public function test__toString() - { - $s = new CalendarStream(); - $item = 'TEST'; - $s->addItem($item); - $expected = 'TEST'.Constants::CRLF; - $this->assertEquals($expected, $s->__toString()); - } -} diff --git a/vendor/jsvrcek/ics/tests/Model/CalendarEventTest.php b/vendor/jsvrcek/ics/tests/Model/CalendarEventTest.php deleted file mode 100644 index 38d93e77..00000000 --- a/vendor/jsvrcek/ics/tests/Model/CalendarEventTest.php +++ /dev/null @@ -1,62 +0,0 @@ -setStart($start); - - // test start - $this->assertEquals($start, $object->getStart()); - - //test default end - $this->assertEquals($start->add(\DateInterval::createFromDateString('30 minutes')), $object->getEnd()); - } - - /** - * @covers Jsvrcek\ICS\Model\CalendarEvent::setEnd - */ - public function testSetEndDateEarlierThanStart() - { - $this->expectException(CalendarEventException::class); - $this->expectExceptionMessage('End DateTime must be greater than Start DateTime'); - - $object = new CalendarEvent; - - $start = new \DateTime('now'); - $end = new \DateTime('yesterday'); - - $object->setStart($start); - $object->setEnd($end); - } - - /** - * @covers Jsvrcek\ICS\Model\CalendarEvent::setEnd - */ - public function testSetEndWithoutStart() - { - $this->expectException(CalendarEventException::class); - $this->expectExceptionMessage('You must set the Start time before setting the End Time of a CalendarEvent'); - - $object = new CalendarEvent; - - $end = new \DateTime('yesterday'); - - $object->setEnd($end); - } -} diff --git a/vendor/jsvrcek/ics/tests/Model/CalendarTest.php b/vendor/jsvrcek/ics/tests/Model/CalendarTest.php deleted file mode 100644 index 2230d5ae..00000000 --- a/vendor/jsvrcek/ics/tests/Model/CalendarTest.php +++ /dev/null @@ -1,23 +0,0 @@ -assertEquals('America/New_York', $c->getTimezone()->getName()); - } -} diff --git a/vendor/jsvrcek/ics/tests/Model/Recurrence/RecurrenceRuleTest.php b/vendor/jsvrcek/ics/tests/Model/Recurrence/RecurrenceRuleTest.php deleted file mode 100644 index 59ef902a..00000000 --- a/vendor/jsvrcek/ics/tests/Model/Recurrence/RecurrenceRuleTest.php +++ /dev/null @@ -1,84 +0,0 @@ -setFrequency(new Frequency(Frequency::YEARLY)) - ->setInterval(2) - ->setCount(10) - ->addByDay(new WeekdayNum(Weekday::MONDAY, 10, WeekdayNum::COUNT_FROM_START)) - ->addByDay(new WeekdayNum(Weekday::TUESDAY, 10, WeekdayNum::COUNT_FROM_END)) - ->setUntil(new \DateTime('2050-01-01 00:00:00', new \DateTimeZone('UTC'))) - ; - - $expected = 'RRULE:FREQ=YEARLY;INTERVAL=2;UNTIL=20500101T000000Z;BYDAY=10MO,-10TU'; - - $this->assertEquals($expected, $object->__toString()); - - //get a new object, test byMonth - $object = new RecurrenceRule(new Formatter()); - - $object - ->setFrequency(new Frequency(Frequency::WEEKLY)) - ->setInterval(1) - ->addByMonth(2) - ->addByMonth(3) - ->addByMonth(4) - ; - - $expected = 'RRULE:FREQ=WEEKLY;INTERVAL=1;BYMONTH=2,3,4'; - - $this->assertEquals($expected, $object->__toString()); - } - - /** - * @covers Jsvrcek\ICS\Model\Recurrence\RecurrentRule::parse() - * @depends testToString - */ - public function testParse() - { - $object = new RecurrenceRule(new Formatter()); - $rRuleString = 'RRULE:FREQ=YEARLY;INTERVAL=2'; - $object->parse($rRuleString); - $this->assertEquals($rRuleString, $object->__toString()); - - $object = new RecurrenceRule(new Formatter()); - $rRuleString = 'RRULE:FREQ=WEEKLY;INTERVAL=4'; - $object->parse($rRuleString); - $this->assertEquals($rRuleString, $object->__toString()); - - $object = new RecurrenceRule(new Formatter()); - $rRuleString = 'RRULE:FREQ=WEEKLY;INTERVAL=4;UNTIL=20500101T000000Z'; - $object->parse($rRuleString); - $this->assertEquals($rRuleString, $object->__toString()); - - $object = new RecurrenceRule(new Formatter()); - $rRuleString = 'RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10'; - $object->parse($rRuleString); - $this->assertEquals(10, $object->getCount()); - $this->assertEquals($rRuleString, $object->__toString()); - - /* - $rRuleString = 'RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10;BYDAY=10MO,-10TU'; - $object->parse($rRuleString); - $this->assertEquals($rRuleString, $object->__toString()); - */ - } -} diff --git a/vendor/jsvrcek/ics/tests/Model/Relationship/AttendeeTest.php b/vendor/jsvrcek/ics/tests/Model/Relationship/AttendeeTest.php deleted file mode 100644 index 22cd1466..00000000 --- a/vendor/jsvrcek/ics/tests/Model/Relationship/AttendeeTest.php +++ /dev/null @@ -1,36 +0,0 @@ -setValue('joe-smith@example.com') - ->setName('Joe Smith') - ->setCalendarUserType('INDIVIDUAL') - ->addCalendarMember('list@example.com') - ->addDelegatedFrom('mary@example.com') - ->addDelegatedTo('sue@example.com') - ->addDelegatedTo('jane@example.com') - ->setParticipationStatus('ACCEPTED') - ->setRole('REQ-PARTICIPANT') - ->setRsvp('TRUE') - ->setSentBy('jack@example.com') - ->setLanguage('en'); - - $expected = 'ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE;DELEGATED-TO="mailto:sue@example.com","mailto:jane@example.com";DELEGATED-FROM="mailto:mary@example.com";SENT-BY="jack@example.com";CN=Joe Smith;LANGUAGE=en:mailto:joe-smith@example.com'; - - $this->assertEquals($expected, $object->__toString()); - } -} diff --git a/vendor/jsvrcek/ics/tests/Model/Relationship/OrganizerTest.php b/vendor/jsvrcek/ics/tests/Model/Relationship/OrganizerTest.php deleted file mode 100644 index bd4eb9e0..00000000 --- a/vendor/jsvrcek/ics/tests/Model/Relationship/OrganizerTest.php +++ /dev/null @@ -1,29 +0,0 @@ -setValue('leonardo@example.it') - ->setName('Leonardo Da Vinci') - ->setLanguage('it') - ->setDirectory('http://en.wikipedia.org/wiki/Leonardo_da_Vinci') - ->setSentBy('piero@example.com'); - - $expected = 'ORGANIZER;SENT-BY="piero@example.com";CN=Leonardo Da Vinci;DIR="http://en.wikipedia.org/wiki/Leonardo_da_Vinci";LANGUAGE=it:mailto:leonardo@example.it'; - - $this->assertEquals($expected, $object->__toString()); - } -} diff --git a/vendor/jsvrcek/ics/tests/Utility/FormatterTest.php b/vendor/jsvrcek/ics/tests/Utility/FormatterTest.php deleted file mode 100644 index 3d77e5f9..00000000 --- a/vendor/jsvrcek/ics/tests/Utility/FormatterTest.php +++ /dev/null @@ -1,269 +0,0 @@ -getFormattedDateTime($dateTime); - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Formatter::getFormattedTimeOffset - */ - public function testGetFormattedTimeOffset() - { - $ce = new Formatter(); - - $offset = -18000; - $expected = '-0500'; - $actual = $ce->getFormattedTimeOffset($offset); - $this->assertEquals($expected, $actual); - - $offset = -14400; - $expected = '-0400'; - $actual = $ce->getFormattedTimeOffset($offset); - $this->assertEquals($expected, $actual); - - $offset = 14400; - $expected = '+0400'; - $actual = $ce->getFormattedTimeOffset($offset); - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Formatter::getFormattedUTCDateTime - */ - public function testGetFormattedUTCDateTime() - { - $ce = new Formatter(); - - $dateTime = new \DateTime('1998-01-18 23:00:00', new \DateTimeZone('America/New_York')); - $expected = '19980119T040000Z'; - $actual = $ce->getFormattedUTCDateTime($dateTime); - $this->assertEquals($expected, $actual); - $ce = new Formatter(); - - $dateTime = new \DateTime('1998-01-18 11:00:00', new \DateTimeZone('America/New_York')); - $expected = '19980118T160000Z'; - $actual = $ce->getFormattedUTCDateTime($dateTime); - $this->assertEquals($expected, $actual); - } - - /** - * @covers \Jsvrcek\ICS\Utility\Formatter::getFormattedDateTimeWithTimeZone - */ - public function testGetFormattedLocalDateTimeWithTimeZone() - { - $ce = new Formatter(); - - $dateTime = new \DateTime('1998-01-18 23:00:00', new \DateTimeZone('America/New_York')); - $expected = 'TZID=America/New_York:19980118T230000'; - $actual = $ce->getFormattedDateTimeWithTimeZone($dateTime); - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Formatter::getFormattedUri - */ - public function testGetFormattedUri() - { - $ce = new Formatter(); - - $expected = 'mailto:test@example.com'; - $actual = $ce->getFormattedUri('test@example.com'); - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Formatter::getFormattedDateInterval - */ - public function testGetFormattedDateInterval() - { - $ce = new Formatter(); - - $tests = array( - "PT15M", - "PT1H", - "P345D", - "P1Y6M29DT4H34M23S" - ); - - foreach ($tests as $test) { - $this->assertEquals( - $test, - $ce->getFormattedDateInterval(new \DateInterval($test)), - $test - ); - } - } - - /** - * @covers Jsvrcek\ICS\\Formatter::getFormattedImageString - */ - public function testGetFormattedImageString() - { - $ce = new Formatter(); - - $tests = [ - [ - 'expected' => 'IMAGE;VALUE=URI;DISPLAY=BADGE;FMTTYPE=image/png:http://example.com/images/party.png', - 'image' => [ - 'VALUE' => 'URI', - 'URI' => 'http://example.com/images/party.png', - 'DISPLAY' => 'BADGE', - 'FMTTYPE' => 'image/png' - ] - ], - [ - 'expected' => 'IMAGE;VALUE=BINARY;ENCODING=BASE64;DISPLAY=BADGE;FMTTYPE=image/png:VGhpcyBpcyBteSBhbWF6aW5nIGltYWdl', - 'image' => [ - 'VALUE' => 'BINARY', - 'ENCODING' => 'BASE64', - 'BINARY' => 'VGhpcyBpcyBteSBhbWF6aW5nIGltYWdl', - 'DISPLAY' => 'BADGE', - 'FMTTYPE' => 'image/png' - ] - ] - ]; - - foreach ($tests as $test) { - $this->assertEquals( - $test['expected'], - $ce->getFormattedImageString($test['image']) - ); - } - } - - /** - * @covers Jsvrcek\ICS\Formatter::getEscapedText - */ - public function testgetEscapedText() - { - $ce = new Formatter(); - - $strings = [ - [ - 'original' => '14 Main St, Capital City', - 'expected' => '14 Main St\, Capital City', - 'name' => 'a comma' - ], - [ - 'original' => 'A comma and a dot; Semi-colon', - 'expected' => 'A comma and a dot\; Semi-colon', - 'name' => 'a semi-colon' - ], - [ - 'original' => 'Here is a comma, and; a semi-colon', - 'expected' => 'Here is a comma\, and\; a semi-colon', - 'name' => 'both comma and semi-colon' - ], - [ - 'original' => 'This comma\, is pre-escaped', - 'expected' => 'This comma\, is pre-escaped', - 'name' => 'a pre-escaped comma' - ], - [ - 'original' => 'Pre-escaped\; This Semi-colon is', - 'expected' => 'Pre-escaped\; This Semi-colon is', - 'name' => 'a pre-escaped semi-colon' - ], - [ - 'original' => 'Pre-escaped\; This Semi-colon is\, and so was that comma', - 'expected' => 'Pre-escaped\; This Semi-colon is\, and so was that comma', - 'name' => 'both a pre-escaped comma and a pre-escaped semi-colon' - ], - [ - 'original' => 'This comma\, was pre-escaped while this one, is not', - 'expected' => 'This comma\, was pre-escaped while this one\, is not', - 'name' => 'a pre-escaped comma and an unescaped comma' - ], - [ - 'original' => 'First\; we pre-escape. Then; we forget to', - 'expected' => 'First\; we pre-escape. Then\; we forget to', - 'name' => 'a pre-escaped semi-colon and an unescaped semi-colon' - ], - [ - 'original' => 'How many, ducks\; Is a question\, This; is not', - 'expected' => 'How many\, ducks\; Is a question\, This\; is not', - 'name' => 'both pre-escaped comma and semi-colon, and unescaped comma and semi-colon' - ], - [ - 'original' => 'It appears that backslashes (\) must also be escaped', - 'expected' => 'It appears that backslashes (\\\) must also be escaped', - 'name' => 'un-escaped backslash' - ], - [ - 'original' => 'It appears that backslashes (\\\) are now escaped', - 'expected' => 'It appears that backslashes (\\\) are now escaped', - 'name' => 'escaped backslash' - ], - [ - 'original' => "But we can't be escaping...\nnew-lines!", - 'expected' => "But we can't be escaping...\nnew-lines!", - 'name' => 'new-line character' - ], - ]; - - foreach ($strings as $string) { - $this->assertEquals( - $string['expected'], - $ce->getEscapedText($string['original']), - 'Failed on escaping string including ' . $string['name'] - ); - } - } - - /** - * @covers \Jsvrcek\ICS\Utility\Formatter::getConferenceText - */ - public function testgetConferenceText() - { - $ce = new Formatter(); - - $conference1 = new Conference('tel:+1-412-555-0123,,,654321'); - $conference2 = new Conference( - 'https://chat.example.com/audio?id=123456', - [ - 'feature' => ['AUDIO', 'VIDEO'], - 'label' => 'Attendee dial-in' - ] - ); - $conference3 = new Conference( - 'xmpp:chat-123@conference.example.com', - [ - 'feature' => 'CHAT', - 'label' => 'Chat Room', - 'language' => 'en:Germany' - ] - ); - - $expected = [ - 'CONFERENCE;VALUE=URI:tel:+1-412-555-0123,,,654321', - 'CONFERENCE;VALUE=URI;FEATURE=AUDIO,VIDEO;LABEL=Attendee dial-in:https://chat.example.com/audio?id=123456', - 'CONFERENCE;VALUE=URI;FEATURE=CHAT;LABEL=Chat Room;LANGUAGE=en:Germany:xmpp:chat-123@conference.example.com' - ]; - $results = [ - $ce->getConferenceText($conference1), - $ce->getConferenceText($conference2), - $ce->getConferenceText($conference3) - ]; - - $this->assertEquals($expected[0], $results[0]); - $this->assertEquals($expected[1], $results[1]); - $this->assertEquals($expected[2], $results[2]); - } -} diff --git a/vendor/jsvrcek/ics/tests/Utility/ProviderTest.php b/vendor/jsvrcek/ics/tests/Utility/ProviderTest.php deleted file mode 100644 index d6a7a4d3..00000000 --- a/vendor/jsvrcek/ics/tests/Utility/ProviderTest.php +++ /dev/null @@ -1,119 +0,0 @@ -add('one'); - $provider->add('two'); - $provider->add('three'); - - $expected = 'one'; - $actual = $provider->first(); - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Utility\Provider::next - * @covers Jsvrcek\ICS\Utility\Provider::current - */ - public function testManualIterate() - { - $provider = new Provider(); - $provider->add('one'); - $provider->add('two'); - $provider->add('three'); - - $expected = ['one', 'two', 'three']; - $actual = []; - foreach ($provider as $item) { - $actual[] = $item; - } - $this->assertEquals($expected, $actual); - } - - /** - * @covers Jsvrcek\ICS\Utility\Provider::first - */ - public function testClosureFirst() - { - $provider = new Provider(function($index) { - switch ($index) { - case 0: return ['one']; - case 1: return ['two']; - case 2: return ['three']; - default: return []; - } - }); - - $expected = 'one'; - $actual = $provider->first(); - $this->assertEquals($expected, $actual); - } - - /** - * Ensure closure is not called more than once when requesting - * - * @covers Jsvrcek\ICS\Utility\Provider::first - */ - public function testClosureFirstCache() - { - $callCount = 0; - $provider = new Provider(function($index) use (&$callCount) { - $callCount++; - switch ($index) { - case 0: return ['one']; - case 1: return ['two']; - case 2: return ['three']; - default: return []; - } - }); - - // simulate iteration of single element - $provider->rewind(); - $provider->valid(); - $current = $provider->current(); - $first = $provider->first(); - $expected = 'one'; - $this->assertEquals($expected, $current); - $this->assertEquals($expected, $first); - $this->assertEquals(1, $callCount); - // ensure callCount is still one if first is called again - $actual = $provider->first(); - $this->assertEquals($expected, $actual); - $this->assertEquals(1, $callCount); - } - - /** - * @covers Jsvrcek\ICS\Utility\Provider::next - * @covers Jsvrcek\ICS\Utility\Provider::current - */ - public function testClosureIterate() - { - $provider = new Provider(function($index) { - switch ($index) { - case 0: return ['one']; - case 1: return ['two']; - case 2: return ['three']; - default: return []; - } - }); - - $expected = ['one', 'two', 'three']; - $actual = []; - foreach ($provider as $item) { - $actual[] = $item; - } - $this->assertEquals($expected, $actual); - } - -} diff --git a/vendor/jsvrcek/ics/tests/test-local-tz.ics b/vendor/jsvrcek/ics/tests/test-local-tz.ics deleted file mode 100644 index 5afdec2b..00000000 --- a/vendor/jsvrcek/ics/tests/test-local-tz.ics +++ /dev/null @@ -1,108 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN -CALSCALE:GREGORIAN -METHOD:PUBLISH -BEGIN:VTIMEZONE -TZID:Antarctica/McMurdo -BEGIN:STANDARD -DTSTART;TZID=+00:00:20130406T140000 -TZOFFSETTO:+1200 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART;TZID=+00:00:20130928T140000 -TZOFFSETTO:+1300 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:lLKjd89283oja89282lkjd8@example.com -DTSTART;TZID=Antarctica/McMurdo:20131004T120000 -DTEND;TZID=Antarctica/McMurdo:20131004T220000 -RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=40;BYDAY=1SA,2SA,3SA,4SA,1FR -SEQUENCE:3 -TRANSP:TRANSPARENT -SUMMARY:Poker night at the South Pole -DESCRIPTION: -DTSTAMP:20130831T120000Z -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ORGANIZER;SENT-BY="mary@example.com";CN=Sue Jones;LANGUAGE=en:mailto:s - ue@example.com -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:AUDIO -ATTACH;FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:DISPLAY -REPEAT:3 -DURATION:PT15M -DESCRIPTION:DESCRIPTION -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:EMAIL -SUMMARY:EMAIL SUBJECT -DESCRIPTION:EMAIL BODY -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ATTACH;FMTTYPE=application/msword:http://example.com/agenda.docx -ATTACH;FMTTYPE=application/pdf:http://example.com/agenda.pdf -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:eventtwo@example.com -DTSTART;TZID=Antarctica/McMurdo:20131002T000000 -DTEND;TZID=Antarctica/McMurdo:20131002T003000 -RRULE:FREQ=WEEKLY -EXDATE:20131016T000000 -EXDATE:20131030T000000 -SUMMARY:Every Wednesday event -DESCRIPTION: -DTSTAMP:20130831T120000Z -END:VEVENT -END:VCALENDAR -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN2 -CALSCALE:GREGORIAN -METHOD:PUBLISH -BEGIN:VTIMEZONE -TZID:Arctic/Longyearbyen -BEGIN:STANDARD -DTSTART;TZID=+00:00:20161030T010000 -TZOFFSETTO:+0100 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART;TZID=+00:00:20160327T010000 -TZOFFSETTO:+0200 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART;TZID=Arctic/Longyearbyen:20160101T010101 -DTEND;TZID=Arctic/Longyearbyen:20160102T010101 -SUMMARY:A long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART;TZID=Arctic/Longyearbyen:20160102T010101 -DTEND;TZID=Arctic/Longyearbyen:20160103T010101 -SUMMARY:Another long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -END:VCALENDAR diff --git a/vendor/jsvrcek/ics/tests/test-local.ics b/vendor/jsvrcek/ics/tests/test-local.ics deleted file mode 100644 index c97981d5..00000000 --- a/vendor/jsvrcek/ics/tests/test-local.ics +++ /dev/null @@ -1,117 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN -CALSCALE:GREGORIAN -METHOD:PUBLISH -BEGIN:VTIMEZONE -TZID:Antarctica/McMurdo -BEGIN:STANDARD -DTSTART:20130406T140000 -TZOFFSETTO:+1200 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20130928T140000 -TZOFFSETTO:+1300 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:lLKjd89283oja89282lkjd8@example.com -DTSTART:20131004T120000 -DTEND:20131004T220000 -RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=40;BYDAY=1SA,2SA,3SA,4SA,1FR -SEQUENCE:3 -TRANSP:TRANSPARENT -COLOR:red -SUMMARY:Poker night at the South Pole -DESCRIPTION: -DTSTAMP:20130831T120000Z -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ORGANIZER;SENT-BY="mary@example.com";CN=Sue Jones;LANGUAGE=en:mailto:s - ue@example.com -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:AUDIO -ATTACH;FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:DISPLAY -REPEAT:3 -DURATION:PT15M -DESCRIPTION:DESCRIPTION -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:EMAIL -SUMMARY:EMAIL SUBJECT -DESCRIPTION:EMAIL BODY -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ATTACH;FMTTYPE=application/msword:http://example.com/agenda.docx -ATTACH;FMTTYPE=application/pdf:http://example.com/agenda.pdf -END:VALARM -CONFERENCE;VALUE=URI:tel:+1-412-555-0123,,,654321 -CONFERENCE;VALUE=URI;FEATURE=AUDIO,VIDEO;LABEL=Attendee dial-in:https: - //chat.example.com/audio?id=123456 -CONFERENCE;VALUE=URI;FEATURE=CHAT;LABEL=Chat Room;LANGUAGE=en:Germany: - xmpp:chat-123@conference.example.com -END:VEVENT -BEGIN:VEVENT -UID:eventtwo@example.com -DTSTART:20131002T000000 -DTEND:20131002T003000 -RRULE:FREQ=WEEKLY -EXDATE:20131016T000000 -EXDATE:20131030T000000 -SUMMARY:Every Wednesday event -DESCRIPTION: -DTSTAMP:20130831T120000Z -FOO:bar -BAR:baz -END:VEVENT -END:VCALENDAR -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN2 -CALSCALE:GREGORIAN -METHOD:PUBLISH -COLOR:green -BEGIN:VTIMEZONE -TZID:Arctic/Longyearbyen -BEGIN:STANDARD -DTSTART:20161030T010000 -TZOFFSETTO:+0100 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20160327T010000 -TZOFFSETTO:+0200 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART:20160101T010101 -DTEND:20160102T010101 -SUMMARY:A long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART:20160102T010101 -DTEND:20160103T010101 -SUMMARY:Another long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -END:VCALENDAR diff --git a/vendor/jsvrcek/ics/tests/test-utc.ics b/vendor/jsvrcek/ics/tests/test-utc.ics deleted file mode 100644 index 607e4671..00000000 --- a/vendor/jsvrcek/ics/tests/test-utc.ics +++ /dev/null @@ -1,109 +0,0 @@ -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN -CALSCALE:GREGORIAN -METHOD:PUBLISH -BEGIN:VTIMEZONE -TZID:Antarctica/McMurdo -BEGIN:STANDARD -DTSTART:20130406T140000Z -TZOFFSETTO:+1200 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20130928T140000Z -TZOFFSETTO:+1300 -TZOFFSETFROM:+1200 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:lLKjd89283oja89282lkjd8@example.com -DTSTART:20131003T230000Z -DTEND:20131004T090000Z -RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=40;BYDAY=1SA,2SA,3SA,4SA,1FR -SEQUENCE:3 -TRANSP:TRANSPARENT -STATUS:CONFIRMED -SUMMARY:Poker night at the South Pole -DESCRIPTION: -DTSTAMP:20130831T120000Z -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ORGANIZER;SENT-BY="mary@example.com";CN=Sue Jones;LANGUAGE=en:mailto:s - ue@example.com -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:AUDIO -ATTACH;FMTTYPE=audio/basic:ftp://example.com/pub/sounds/bell-01.aud -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:DISPLAY -REPEAT:3 -DURATION:PT15M -DESCRIPTION:DESCRIPTION -END:VALARM -BEGIN:VALARM -TRIGGER;VALUE=DATE-TIME:20131003T230000Z -ACTION:EMAIL -SUMMARY:EMAIL SUBJECT -DESCRIPTION:EMAIL BODY -ATTENDEE;CUTYPE=INDIVIDUAL;MEMBER="mailto:list@example.com";ROLE=REQ-P - ARTICIPANT;PARTSTAT=ACCEPTED;SENT-BY="joe@example";CN=Jane Smith:mailt - o:jane-smith@example.com -ATTACH;FMTTYPE=application/msword:http://example.com/agenda.docx -ATTACH;FMTTYPE=application/pdf:http://example.com/agenda.pdf -END:VALARM -END:VEVENT -BEGIN:VEVENT -UID:eventtwo@example.com -DTSTART:20131001T110000Z -DTEND:20131001T113000Z -RRULE:FREQ=WEEKLY -EXDATE:20131016T000000 -EXDATE:20131030T000000 -SUMMARY:Every Wednesday event -DESCRIPTION: -DTSTAMP:20130831T120000Z -END:VEVENT -END:VCALENDAR -BEGIN:VCALENDAR -VERSION:2.0 -PRODID:-//Jsvrcek//ICS//EN2 -CALSCALE:GREGORIAN -METHOD:PUBLISH -BEGIN:VTIMEZONE -TZID:Arctic/Longyearbyen -BEGIN:STANDARD -DTSTART:20161030T010000Z -TZOFFSETTO:+0100 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU -END:STANDARD -BEGIN:DAYLIGHT -DTSTART:20160327T010000Z -TZOFFSETTO:+0200 -TZOFFSETFROM:+0100 -RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU -END:DAYLIGHT -END:VTIMEZONE -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART:20160101T000101Z -DTEND:20160102T000101Z -SUMMARY:A long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -BEGIN:VEVENT -UID:asdfasdf@example.com -DTSTART:20160102T000101Z -DTEND:20160103T000101Z -SUMMARY:Another long day -DESCRIPTION: -DTSTAMP:20130831T220000Z -END:VEVENT -END:VCALENDAR From 3610cb4132decad0e99e1b29f39bf27270f4a1c2 Mon Sep 17 00:00:00 2001 From: Barbara Bothe Date: Wed, 9 Aug 2023 15:54:31 +0200 Subject: [PATCH 11/17] Update Export.php --- includes/ICS/Export.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/includes/ICS/Export.php b/includes/ICS/Export.php index 6dc1a734..643f5a1c 100644 --- a/includes/ICS/Export.php +++ b/includes/ICS/Export.php @@ -137,9 +137,12 @@ private function stream() public static function makeIcsLink(array $args) { $args['ids'] = $args['ids'] ?? false; - $args['cats'] = $args['cats'] ?? false; - $args['tags'] = $args['tags'] ?? false; - $qArgs = ['ical-plugin' => plugin()->getSlug()]; + $args['cats'] = $args['cats'] ?? false; // array of term id(s) + $args['tags'] = $args['tags'] ?? false; // array of term id(s) + $qArgs = [ + 'ical-plugin' => plugin()->getSlug(), + 'action' => 'export' + ]; foreach ($args as $k => $v) { if ($v && is_array($v)) { From ccdcb3a487c95c00032579f8c337e7761eb80b3c Mon Sep 17 00:00:00 2001 From: Barbara Bothe Date: Thu, 10 Aug 2023 11:28:41 +0200 Subject: [PATCH 12/17] =?UTF-8?q?Bugfix=20Uhrzeit=20mehrt=C3=A4gig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/ICS/Events.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/ICS/Events.php b/includes/ICS/Events.php index b687c7ff..f4dac885 100644 --- a/includes/ICS/Events.php +++ b/includes/ICS/Events.php @@ -468,10 +468,10 @@ public static function getListData(int $postId, array $items, string $searchTerm if ($time !== 'all-day') { if (!empty($event['start'])) { $mtime = ' ' . $event['start']; - $dtStart = get_gmt_from_date($dtStart . ' ' . $event['start']); + $dtStart = $dtStart . ' ' . $event['start']; if (!empty($event['end']) && $event['end'] != $event['start']) { $mtime .= ' – ' . $event['end']; - $dtEnd = get_gmt_from_date($dtEnd . ' ' . $event['end']); + $dtEnd = $dtEnd . ' ' . $event['end']; } else { $dtEnd = $dtStart; } @@ -618,8 +618,8 @@ public static function insertData(int $postId) wp_set_post_terms($eventId, $termIds, CalendarEvent::TAX_TAG); } - $dtStart = strtotime(get_date_from_gmt($event['dt_start'])); - $dtEnd = strtotime(get_date_from_gmt($event['dt_end'])); + $dtStart = strtotime($event['dt_start']); + $dtEnd = strtotime($event['dt_end']); add_post_meta($eventId, 'start', $dtStart, true); add_post_meta($eventId, 'end', $dtEnd, true); From d49bb97b63dbfc5e219d4389e1f304f59473a39a Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 10 Aug 2023 15:41:03 +0200 Subject: [PATCH 13/17] Update Export.php --- includes/ICS/Export.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/ICS/Export.php b/includes/ICS/Export.php index 643f5a1c..d20f7ef3 100644 --- a/includes/ICS/Export.php +++ b/includes/ICS/Export.php @@ -26,11 +26,15 @@ public function request() $plugin === sanitize_title(plugin()->getSlug()) && $action === 'export' ) { + $postIds = $_GET['ids'] ?? ''; + $cats = $_GET['cats'] ?? ''; + $tags = $_GET['tags'] ?? ''; $args = [ - 'postIds' => $_GET['ids'] ?: false, - 'categories' => $_GET['cats'] ?: false, - 'tags' => $_GET['tags'] ?: false + 'postIds' => array_filter(explode(',', $postIds)), + 'categories' => array_filter(explode(',', $cats)), + 'tags' => array_filter(explode(',', $tags)), ]; + $this->set($args); $this->stream(); } @@ -79,7 +83,7 @@ private function set(array $args) ]; if (!empty($postIn)) { - $args = array_merge($args, ['post__in' => $postIds]); + $args = array_merge($args, ['post__in' => $postIn]); } if (!empty($taxQuery)) { $taxQuery = array_merge(['relation' => 'AND'], $taxQuery); @@ -100,10 +104,10 @@ private function getEvents(array $posts) $meta = get_post_meta($post->ID, '', true); $data[$post->ID] = [ 'summary' => $post->post_title, - 'uid' => $meta['event-uid'], - 'description' => $meta['description'], - 'dstart' => $meta['start'], - 'dtend' => $meta['end'] + 'uid' => $meta['event-uid'][0], + 'description' => $meta['description'][0], + 'dtstart' => date('Y-m-d H:i:s', $meta['start'][0]), + 'dtend' => date('Y-m-d H:i:s', $meta['end'][0]), ]; } return $data; @@ -136,13 +140,13 @@ private function stream() public static function makeIcsLink(array $args) { - $args['ids'] = $args['ids'] ?? false; + $args['ids'] = $args['ids'] ?? false; // array of post id(s) $args['cats'] = $args['cats'] ?? false; // array of term id(s) $args['tags'] = $args['tags'] ?? false; // array of term id(s) $qArgs = [ 'ical-plugin' => plugin()->getSlug(), 'action' => 'export' - ]; + ]; foreach ($args as $k => $v) { if ($v && is_array($v)) { From 67c79d6aa56392502b8696dd4d507d33e676a4e6 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 10 Aug 2023 15:41:07 +0200 Subject: [PATCH 14/17] Update ICS.php --- includes/ICS/ICS.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php index 949a508f..03a49e56 100644 --- a/includes/ICS/ICS.php +++ b/includes/ICS/ICS.php @@ -26,21 +26,15 @@ public function __construct(array $data) public function setData(array $data) { - foreach ($data as $k => $v) { - if (is_array($v)) { - $this->data[$k] = $this->setProps($v); - } + foreach ($data as $postId => $props) { + $this->data[$postId] = $this->setProps($props); } } - public function setProps($key, string $value = '') + private function setProps(array $props) { $properties = []; - if (is_array($key)) { - foreach ($key as $k => $v) { - $this->setProps($k, $v); - } - } else { + foreach ($props as $key => $value) { if (in_array($key, $this->availableProperties)) { $properties[$key] = $this->sanitizeValue($value, $key); } From cf35c2ccf28691f21338ca909bfd7892d35b0ac2 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 10 Aug 2023 15:41:30 +0200 Subject: [PATCH 15/17] Update Main.php --- includes/Main.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/Main.php b/includes/Main.php index 247a3ce7..abbc66f5 100644 --- a/includes/Main.php +++ b/includes/Main.php @@ -6,6 +6,7 @@ use RRZE\Calendar\CPT\{CalendarEvent, CalendarFeed}; use RRZE\Calendar\Shortcodes\Shortcode; +use RRZE\Calendar\ICS\Export; class Main { @@ -24,6 +25,8 @@ public function __construct() Update::init(); + new Export(); + Shortcode::init(); Cron::init(); From b3f4c207e30ac241e359ac5af14a01ffc5e32e2f Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 10 Aug 2023 16:10:34 +0200 Subject: [PATCH 16/17] Update Export.php --- includes/ICS/Export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/ICS/Export.php b/includes/ICS/Export.php index d20f7ef3..5a94f112 100644 --- a/includes/ICS/Export.php +++ b/includes/ICS/Export.php @@ -128,8 +128,8 @@ private function stream() $urlPath = parse_url(site_url(), PHP_URL_PATH); $filename = sprintf( '%1$s%2$s.ics', - $urlHost, - $urlPath ? '-' . $urlPath : '' + sanitize_title($urlHost), + $urlPath ? '-' . sanitize_title($urlPath) : '' ); header('Content-Type: text/calendar; charset=' . get_option('blog_charset'), true); From 5d64d7a0a7b0ff0cb685e142cc011a4d909b5600 Mon Sep 17 00:00:00 2001 From: rvdforst Date: Thu, 10 Aug 2023 16:10:37 +0200 Subject: [PATCH 17/17] Update ICS.php --- includes/ICS/ICS.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/ICS/ICS.php b/includes/ICS/ICS.php index 03a49e56..55044c70 100644 --- a/includes/ICS/ICS.php +++ b/includes/ICS/ICS.php @@ -44,7 +44,10 @@ private function setProps(array $props) public function build() { - $rows = $this->render(); + $rows = array_map( + fn ($row): string => $this->split($row), + $this->render() + ); return implode("\r\n", $rows); } @@ -89,7 +92,6 @@ private function sanitizeValue($value, $key = false) default: $value = $this->escStr($value); $value = str_replace("\r\n", "\\n", $value); - $value = $this->split($value); } return $value;