forked from mirrors/easyappointments
Updated the Ics_file.php library to work with the updated code.
This commit is contained in:
parent
f540922abc
commit
23d80259d9
1 changed files with 18 additions and 15 deletions
|
@ -23,32 +23,35 @@ use Jsvrcek\ICS\Model\Relationship\Organizer;
|
|||
use Jsvrcek\ICS\Utility\Formatter;
|
||||
|
||||
/**
|
||||
* Class Ics_file
|
||||
* Ics file library
|
||||
*
|
||||
* An ICS file is a calendar file saved in a universal calendar format used by several email and calendar programs,
|
||||
* Handle ICS related functionality.
|
||||
*
|
||||
* An ICS file is a calendar file saved in a universal calendar format used by many email and calendar programs,
|
||||
* including Microsoft Outlook, Google Calendar, and Apple Calendar.
|
||||
*
|
||||
* Depends on the Jsvrcek\ICS composer package.
|
||||
* @package Libraries
|
||||
*/
|
||||
class Ics_file {
|
||||
/**
|
||||
* Get the ICS file contents for the provided arguments.
|
||||
*
|
||||
* @param array $appointment Appointment.
|
||||
* @param array $service Service.
|
||||
* @param array $provider Provider.
|
||||
* @param array $customer Customer.
|
||||
* @param array $appointment Appointment data.
|
||||
* @param array $service Service data.
|
||||
* @param array $provider Provider data.
|
||||
* @param array $customer Customer data.
|
||||
*
|
||||
* @return string Returns the contents of the ICS file.
|
||||
*
|
||||
* @throws CalendarEventException
|
||||
* @throws Exception
|
||||
*/
|
||||
public function get_stream($appointment, $service, $provider, $customer)
|
||||
public function get_stream(array $appointment, array $service, array $provider, array $customer): string
|
||||
{
|
||||
$appointment_timezone = new DateTimeZone($provider['timezone']);
|
||||
|
||||
$appointment_start = new DateTime($appointment['start_datetime'], $appointment_timezone);
|
||||
|
||||
$appointment_end = new DateTime($appointment['end_datetime'], $appointment_timezone);
|
||||
|
||||
// Set up the event.
|
||||
|
@ -83,7 +86,7 @@ class Ics_file {
|
|||
'',
|
||||
lang('name') . ': ' . $customer['first_name'] . ' ' . $customer['last_name'],
|
||||
lang('email') . ': ' . $customer['email'],
|
||||
lang('phone_number') . ': ' . $customer['phone_number'],
|
||||
lang('phone_number') . ': ' . ($customer['phone_number'] ?? '-'),
|
||||
lang('address') . ': ' . $customer['address'],
|
||||
lang('city') . ': ' . $customer['city'],
|
||||
lang('zip_code') . ': ' . $customer['zip_code'],
|
||||
|
|
Loading…
Reference in a new issue